Library for ELEC2645 Gamepad PCB. University of Leeds Version 2 January 2020
Dependents: ELEC2645_Ticker_WAV ELEC2645_Project_username ELEC2645_Project_el18vgt ELEC2645_Project_el17oc11 ... more
Diff: Gamepad.h
- Revision:
- 5:ce5eae9ee934
- Parent:
- 4:bafb7f483e93
- Child:
- 6:b1c3dfe67f7d
diff -r bafb7f483e93 -r ce5eae9ee934 Gamepad.h --- a/Gamepad.h Mon Feb 06 19:40:40 2017 +0000 +++ b/Gamepad.h Mon Feb 06 19:47:59 2017 +0000 @@ -52,12 +52,14 @@ bool r_pressed(); bool back_pressed(); bool start_pressed(); - bool joystick_pressed(); + float get_mag(); float get_angle(); Direction get_direction(); // N,NE,E,SE etc. - + Vector2D get_coord(); // cartesian co-ordinates x,y + Vector2D get_mapped_coord(); // x,y mapped to circle + Polar get_polar(); // mag and angle in struct form private: @@ -99,10 +101,6 @@ void start_isr(); void joy_isr(); - Vector2D get_coord(); // cartesian co-ordinates x,y - Vector2D get_mapped_coord(); // x,y mapped to circle - Polar get_polar(); // mag and angle in struct form - bool a_flag,b_flag,x_flag,y_flag,l_flag,r_flag,back_flag,start_flag,joy_flag; // centred x,y values