Library for Sparkfun analog joystick
Fork of SparkfunAnalogJoystick by
SparkfunAnalogJoystick.h
- Committer:
- ryanzhang1994
- Date:
- 2015-03-08
- Revision:
- 1:ed0057aa2e31
- Parent:
- 0:ed9ee35481a9
- Child:
- 3:2b40241a7675
File content as of revision 1:ed0057aa2e31:
#ifndef SPARKFUN_ANALOG_JOYSTICK #define SPARKFUN_ANALOG_JOYSTICK #include "mbed.h" class SparkfunAnalogJoystick { public: // Constructor SparkfunAnalogJoystick(PinName, PinName, PinName); // Get the button status, 1 for on and 0 for off int button(); // X axis value float xAxis(); // Y axis value float yAxis(); // Angle value in polar coordinates float angle(); // Distance value in polar coordinates float distance(); protected: AnalogIn VERT; AnalogIn HORZ; DigitalIn SEL; }; #endif