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: Lab4 4180final_receiver 4180final_sender DuelingTanks ... more
Fork of SparkfunAnalogJoystick by
SparkfunAnalogJoystick.h
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 Thu Jul 14 2022 02:47:17 by
1.7.2
