This Class allows the joystick, buttons and petiometers to be implemented easily and coherently in other classes

Fork of Gamepad by Craig Evans

Revision:
26:ccdf299b26c4
Parent:
25:edb07ff38749
Child:
28:7c0dbbd90c2e
--- a/Controller.h	Sun Apr 16 19:38:43 2017 +0000
+++ b/Controller.h	Sun Apr 16 21:18:08 2017 +0000
@@ -69,7 +69,8 @@
     mbed::Timeout *_timeout;
 
     std::bitset<N_EVENTS> _event_state; ///< A binary list of buttons that has been pressed
-
+    float _x0;
+    
 public:
 
     /** Constructor */
@@ -117,13 +118,20 @@
     bool check_event(ControllerEvent const id);
 
     /**
+     * @brief Checks if joystick is flicked
+     * @return x value
+     */
+     
+    float get_joy();
+
+    /**
      * @brief Allows for a specific integer to be returned if a specific flag has been set
-     * @param id[in] boolean true/false on whether a specific flag has been set.
      * @return interger unique to the flag set.
      */
     int check_for_buttons();
 
 
+
 private:
     void init_buttons();
     void sound_off();