Library for Sparkfun analog joystick
Fork of SparkfunAnalogJoystick by
Diff: SparkfunAnalogJoystick.h
- Revision:
- 1:ed0057aa2e31
- Parent:
- 0:ed9ee35481a9
- Child:
- 3:2b40241a7675
diff -r ed9ee35481a9 -r ed0057aa2e31 SparkfunAnalogJoystick.h --- a/SparkfunAnalogJoystick.h Sat Mar 07 23:28:06 2015 +0000 +++ b/SparkfunAnalogJoystick.h Sun Mar 08 05:43:45 2015 +0000 @@ -5,19 +5,21 @@ class SparkfunAnalogJoystick { -public: - SparkfunAnalogJoystick(PinName, PinName, PinName); - - int button(); - - float xAxis(); +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;