Finished V1
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
hardware.h@0:35660d7952f7, 2018-03-30 (annotated)
- Committer:
- rconnorlawson
- Date:
- Fri Mar 30 17:07:25 2018 +0000
- Revision:
- 0:35660d7952f7
Hollowed out shell code.
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 { |
rconnorlawson | 0:35660d7952f7 | 9 | int b1, b2, b3; // 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 |