Analog Joystick Library
Fork of SparkfunAnalogJoystick by
Embed:
(wiki syntax)
Show/hide line numbers
SparkfunAnalogJoystick.h
Go to the documentation of this file.
00001 /** Analog Joystick APIs 00002 * Used as a user interface for Sparkfun Analog Joystick Module 00003 * @file SparkfunAnalogJoystick.h 00004 * @author Yuan,ZHANG; Jiajie,YANG 00005 */ 00006 00007 #ifndef SPARKFUN_ANALOG_JOYSTICK 00008 #define SPARKFUN_ANALOG_JOYSTICK 00009 00010 #include "mbed.h" 00011 00012 /** Joystick class. 00013 * User Interface to use Sparkfun Joystick Module 00014 */ 00015 class SparkfunAnalogJoystick 00016 { 00017 00018 public: 00019 // Constructor of Joystick object 00020 SparkfunAnalogJoystick(PinName, PinName, PinName); 00021 // Get the button status, 1 for on and 0 for off 00022 int button(); 00023 // X axis value 00024 float xAxis(); 00025 // Y axis value 00026 float yAxis(); 00027 // Angle value in polar coordinates 00028 float angle(); 00029 // Distance value in polar coordinates 00030 float distance(); 00031 00032 protected: 00033 AnalogIn VERT; 00034 AnalogIn HORZ; 00035 DigitalIn SEL; 00036 00037 }; 00038 00039 #endif
Generated on Tue Jul 12 2022 18:33:56 by 1.7.2