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.
Joystick Class Reference
#include <Joystick.h>
Detailed Description
Joystick Class.
Example:
#include "mbed.h" #include "Joystick.h" // y x button Joystick joystick(PTB10,PTB11,PTC16); int main() { joystick.init(); while(1) { Vector2D coord = joystick.get_coord(); printf("Coord = %f,%f\n",coord.x,coord.y); Vector2D mapped_coord = joystick.get_mapped_coord(); printf("Mapped coord = %f,%f\n",mapped_coord.x,mapped_coord.y); float mag = joystick.get_mag(); float angle = joystick.get_angle(); printf("Mag = %f Angle = %f\n",mag,angle); Direction d = joystick.get_direction(); printf("Direction = %i\n",d); if (joystick.button_pressed() ) { printf("Button Pressed\n"); } wait(0.5); } }
Definition at line 77 of file Joystick.h.
Generated on Wed Jul 13 2022 13:02:18 by
