this is lame
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
hardware.h@2:c5848a443855, 2019-04-11 (annotated)
- Committer:
- kalejandro3
- Date:
- Thu Apr 11 23:01:11 2019 +0000
- Revision:
- 2:c5848a443855
- Parent:
- 0:35660d7952f7
first mercurial commit;
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 { |
kalejandro3 | 2:c5848a443855 | 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 |