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