Pong game for ELEC1620 board.
Joystick Class Reference
#include <Joystick.h>
Detailed Description
Joystick Class.
Example:
#include "mbed.h" #include "Joystick.h" // y x button Joystick joystick(PTB11,PTB10); 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); wait(0.5); } }
Definition at line 55 of file Joystick.h.
Generated on Thu Jul 14 2022 15:46:36 by 1.7.2