Snake
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
hardware.h@3:2fe73b263a9a, 2020-11-23 (annotated)
- Committer:
- congvu
- Date:
- Mon Nov 23 05:54:49 2020 +0000
- Revision:
- 3:2fe73b263a9a
- Parent:
- 2:4947d6a82971
ECE2035;
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
DCchico | 2:4947d6a82971 | 1 | // Copyright 2020 Georgia Tech. All rights reserved. |
DCchico | 2:4947d6a82971 | 2 | // The materials provided by the instructor in this course are for |
DCchico | 2:4947d6a82971 | 3 | // the use of the students currently enrolled in the course. |
DCchico | 2:4947d6a82971 | 4 | // Copyrighted course materials may not be further disseminated. |
DCchico | 2:4947d6a82971 | 5 | // This file must not be made publicly available anywhere. |
DCchico | 2:4947d6a82971 | 6 | |
DCchico | 1:10330bce85cb | 7 | #ifndef HARDWARE_H |
DCchico | 1:10330bce85cb | 8 | #define HARDWARE_H |
DCchico | 1:10330bce85cb | 9 | |
DCchico | 1:10330bce85cb | 10 | /** |
DCchico | 1:10330bce85cb | 11 | * Structure that represents all the inputs to the game. |
DCchico | 1:10330bce85cb | 12 | * If additional hardware is added, new elements should be added to this struct. |
DCchico | 1:10330bce85cb | 13 | */ |
DCchico | 1:10330bce85cb | 14 | struct GameInputs { |
DCchico | 1:10330bce85cb | 15 | int b1, b2, b3; // Button presses |
DCchico | 1:10330bce85cb | 16 | double ax, ay, az; // Accelerometer readings |
DCchico | 1:10330bce85cb | 17 | }; |
DCchico | 1:10330bce85cb | 18 | |
DCchico | 1:10330bce85cb | 19 | /** |
DCchico | 1:10330bce85cb | 20 | * Initialize all the hardware. |
DCchico | 1:10330bce85cb | 21 | */ |
DCchico | 1:10330bce85cb | 22 | int hardware_init(); |
DCchico | 1:10330bce85cb | 23 | |
DCchico | 1:10330bce85cb | 24 | /** |
DCchico | 1:10330bce85cb | 25 | * Read all the user inputs. |
DCchico | 1:10330bce85cb | 26 | * This is all input hardware interaction should happen. |
DCchico | 1:10330bce85cb | 27 | * Returns a GameInputs struct that has all the inputs recorded. |
DCchico | 1:10330bce85cb | 28 | * This GameInputs is used elsewhere to compute the game update. |
DCchico | 1:10330bce85cb | 29 | */ |
DCchico | 1:10330bce85cb | 30 | GameInputs read_inputs(); |
DCchico | 1:10330bce85cb | 31 | |
DCchico | 1:10330bce85cb | 32 | #endif // HARDWARE_H |