Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Joystick.h
- Revision:
 - 3:82731de4e878
 - Parent:
 - 2:c9f2a9e2f304
 - Child:
 - 4:9553952c95f5
 
--- a/Joystick.h	Thu May 05 11:00:46 2016 +0000
+++ b/Joystick.h	Sun Jun 07 16:55:47 2020 +0000
@@ -14,7 +14,7 @@
 @brief Joystick is just 2 potentiometers and a button so can be interfaced with AnalogIn and DigitalIn/InterruptIn
 @brief The library contains a method to prevent button debounce with a Timeout
 
-@author Avinash Patel
+@author Avinash Patel and fixer zayats1
 @date April 2016
  * Example
  * @code
@@ -103,28 +103,19 @@
     /** Sets the button flag
     * @param value The value the flag will be set to
     */
-    void set_button_flag(bool value);
 
 private:
-    void button_isr();
-    void button_fall_isr();
-    void button_debounce_isr();
-private:
     //Pin inputs
     AnalogIn* x_axis_;
     AnalogIn* y_axis_;
-    InterruptIn* button_;
-
-    //Ticker to prevent joystick button bounce
-    Timeout* button_debounce_;
+    DigitalIn* button_;
 
     //Stores X and Y offsets
     float x_offset_;
     float y_offset_;
 
-    //Stores interrupt flags
-    volatile bool g_button_flag_;
-    volatile bool g_button_debounce_flag_;
+    //returns one or zero
+    volatile int g_button_flag_;
 };
 
 #endif
\ No newline at end of file