ESE519 blank Joystick class
Dependents: ESE519_Lab6_part1_skeleton
Fork of Joystick_skelleton by
Diff: Joystick.h
- Revision:
- 2:893fd930d3fb
- Parent:
- 1:c42a77267f7b
--- a/Joystick.h Thu Oct 20 22:16:14 2016 +0000 +++ b/Joystick.h Thu Oct 20 23:12:18 2016 +0000 @@ -3,19 +3,19 @@ #include "mbed.h" -#define DEAD_ZONE 4 //size of the dead zone ...-3,-2,-1 [-2...0...+2] 1,2,3... +#define DEAD_ZONE 2 //where values will be set to zero. [-2,+2] class Joystick { public: //Function and variables go here Joystick(PinName pinA, PinName pinB); //Constructor - float horizontal(void); - float vertical(void); - void setScale(float min, float max); + float horizontal(void); //Reads horizontal value of joystick + float vertical(void); //Reads vertical value of joystick + void setScale(float min, float max); //Set the scale of values private: - AnalogIn horiz; - AnalogIn vert; + AnalogIn horiz; //horizontal pot in joystick + AnalogIn vert; //Vertical pot in joystick float _min, _max; //Min and Max for scaling float rawMinH, rawMaxH, rawMinV, rawMaxV; //Max/Min raw values we have seen so far