![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Finished V1
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
hardware.h@5:2fb023cdc666, 2019-11-24 (annotated)
- Committer:
- trich9
- Date:
- Sun Nov 24 03:22:35 2019 +0000
- Revision:
- 5:2fb023cdc666
- Parent:
- 0:35660d7952f7
finished V1
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 |