Digital Joystick
Joystick Class Reference
Digital Joystick class. More...
#include <Joystick.h>
Public Member Functions | |
| Joystick (PinName up, PinName down, PinName left, PinName right, PinName press) | |
| Create a Joystick HID for using regular mbed pins. | |
| Status | getStatus () |
| Get status Read the joystick status. | |
Detailed Description
Digital Joystick class.
Used for an digital joystick.
Example:
#include "mbed.h" #include "Joystick.h" Joystick joystick(P2_3, P0_15, P2_4, P0_16, P0_17); int main() { joystick.getStatus(); }
Definition at line 34 of file Joystick.h.
Constructor & Destructor Documentation
| Joystick | ( | PinName | up, |
| PinName | down, | ||
| PinName | left, | ||
| PinName | right, | ||
| PinName | press | ||
| ) |
Member Function Documentation
| Joystick::Status getStatus | ( | ) |
Get status Read the joystick status.
switch (joystick.getStatus()) { case Joystick::none: break; case Joystick::up: break; case Joystick::down: break; case Joystick::left: break; case Joystick::right: break; case Joystick::press: break; default: break; }
- Returns:
- A uint8_t values representing the bits
- Status of joystick
Definition at line 31 of file Joystick.cpp.
Generated on Wed Jul 13 2022 17:58:21 by
1.7.2