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.
Dependents: ESE519_Lab6_part1_skeleton
Fork of Joystick_skelleton by
Joystick.h
00001 #ifndef _Joystick_h 00002 #define _Joystick_h 00003 00004 #include "mbed.h" 00005 00006 #define DEAD_ZONE 2 //where values will be set to zero. [-2,+2] 00007 00008 class Joystick 00009 { 00010 public: //Function and variables go here 00011 Joystick(PinName pinA, PinName pinB); //Constructor 00012 float horizontal(void); //Reads horizontal value of joystick 00013 float vertical(void); //Reads vertical value of joystick 00014 void setScale(float min, float max); //Set the scale of values 00015 00016 private: 00017 AnalogIn horiz; //horizontal pot in joystick 00018 AnalogIn vert; //Vertical pot in joystick 00019 00020 float _min, _max; //Min and Max for scaling 00021 float rawMinH, rawMaxH, rawMinV, rawMaxV; //Max/Min raw values we have seen so far 00022 float raw_hc, raw_vc; //Raw Center values 00023 }; 00024 00025 #endif
Generated on Wed Jul 13 2022 08:18:41 by
1.7.2
