game for 2035
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
hardware.h@2:06c63d567719, 2018-11-30 (annotated)
- Committer:
- Sterofin
- Date:
- Fri Nov 30 02:53:05 2018 +0000
- Revision:
- 2:06c63d567719
- Parent:
- 0:35660d7952f7
doot
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
rconnorlawson | 0:35660d7952f7 | 1 | #ifndef HARDWARE_H |
rconnorlawson | 0:35660d7952f7 | 2 | #define HARDWARE_H |
rconnorlawson | 0:35660d7952f7 | 3 | |
rconnorlawson | 0:35660d7952f7 | 4 | /** |
rconnorlawson | 0:35660d7952f7 | 5 | * Structure that represents all the inputs to the game. |
rconnorlawson | 0:35660d7952f7 | 6 | * If additional hardware is added, new elements should be added to this struct. |
rconnorlawson | 0:35660d7952f7 | 7 | */ |
rconnorlawson | 0:35660d7952f7 | 8 | struct GameInputs { |
Sterofin | 2:06c63d567719 | 9 | int b1, b2, b3, b4; // Button presses |
rconnorlawson | 0:35660d7952f7 | 10 | double ax, ay, az; // Accelerometer readings |
rconnorlawson | 0:35660d7952f7 | 11 | }; |
rconnorlawson | 0:35660d7952f7 | 12 | |
rconnorlawson | 0:35660d7952f7 | 13 | /** |
rconnorlawson | 0:35660d7952f7 | 14 | * Initialize all the hardware. |
rconnorlawson | 0:35660d7952f7 | 15 | */ |
rconnorlawson | 0:35660d7952f7 | 16 | int hardware_init(); |
rconnorlawson | 0:35660d7952f7 | 17 | |
rconnorlawson | 0:35660d7952f7 | 18 | /** |
rconnorlawson | 0:35660d7952f7 | 19 | * Read all the user inputs. |
rconnorlawson | 0:35660d7952f7 | 20 | * This is all input hardware interaction should happen. |
rconnorlawson | 0:35660d7952f7 | 21 | * Returns a GameInputs struct that has all the inputs recorded. |
rconnorlawson | 0:35660d7952f7 | 22 | * This GameInputs is used elsewhere to compute the game update. |
rconnorlawson | 0:35660d7952f7 | 23 | */ |
rconnorlawson | 0:35660d7952f7 | 24 | GameInputs read_inputs(); |
rconnorlawson | 0:35660d7952f7 | 25 | |
rconnorlawson | 0:35660d7952f7 | 26 | #endif // HARDWARE_H |