![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
hgftf
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
hardware.h@1:10330bce85cb, 2020-10-23 (annotated)
- Committer:
- DCchico
- Date:
- Fri Oct 23 16:18:39 2020 -0400
- Revision:
- 1:10330bce85cb
- Child:
- 2:4947d6a82971
shell-code
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DCchico | 1:10330bce85cb | 1 | #ifndef HARDWARE_H |
DCchico | 1:10330bce85cb | 2 | #define HARDWARE_H |
DCchico | 1:10330bce85cb | 3 | |
DCchico | 1:10330bce85cb | 4 | /** |
DCchico | 1:10330bce85cb | 5 | * Structure that represents all the inputs to the game. |
DCchico | 1:10330bce85cb | 6 | * If additional hardware is added, new elements should be added to this struct. |
DCchico | 1:10330bce85cb | 7 | */ |
DCchico | 1:10330bce85cb | 8 | struct GameInputs { |
DCchico | 1:10330bce85cb | 9 | int b1, b2, b3; // Button presses |
DCchico | 1:10330bce85cb | 10 | double ax, ay, az; // Accelerometer readings |
DCchico | 1:10330bce85cb | 11 | }; |
DCchico | 1:10330bce85cb | 12 | |
DCchico | 1:10330bce85cb | 13 | /** |
DCchico | 1:10330bce85cb | 14 | * Initialize all the hardware. |
DCchico | 1:10330bce85cb | 15 | */ |
DCchico | 1:10330bce85cb | 16 | int hardware_init(); |
DCchico | 1:10330bce85cb | 17 | |
DCchico | 1:10330bce85cb | 18 | /** |
DCchico | 1:10330bce85cb | 19 | * Read all the user inputs. |
DCchico | 1:10330bce85cb | 20 | * This is all input hardware interaction should happen. |
DCchico | 1:10330bce85cb | 21 | * Returns a GameInputs struct that has all the inputs recorded. |
DCchico | 1:10330bce85cb | 22 | * This GameInputs is used elsewhere to compute the game update. |
DCchico | 1:10330bce85cb | 23 | */ |
DCchico | 1:10330bce85cb | 24 | GameInputs read_inputs(); |
DCchico | 1:10330bce85cb | 25 | |
DCchico | 1:10330bce85cb | 26 | #endif // HARDWARE_H |