SNAKE GAME

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Committer:
congvu
Date:
Wed Nov 25 04:25:25 2020 +0000
Revision:
0:24041b847eb5
ECE2035 SNAKE GAME;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
congvu 0:24041b847eb5 1 // Copyright 2020 Georgia Tech. All rights reserved.
congvu 0:24041b847eb5 2 // The materials provided by the instructor in this course are for
congvu 0:24041b847eb5 3 // the use of the students currently enrolled in the course.
congvu 0:24041b847eb5 4 // Copyrighted course materials may not be further disseminated.
congvu 0:24041b847eb5 5 // This file must not be made publicly available anywhere.
congvu 0:24041b847eb5 6
congvu 0:24041b847eb5 7 #ifndef HARDWARE_H
congvu 0:24041b847eb5 8 #define HARDWARE_H
congvu 0:24041b847eb5 9
congvu 0:24041b847eb5 10 /**
congvu 0:24041b847eb5 11 * Structure that represents all the inputs to the game.
congvu 0:24041b847eb5 12 * If additional hardware is added, new elements should be added to this struct.
congvu 0:24041b847eb5 13 */
congvu 0:24041b847eb5 14 struct GameInputs {
congvu 0:24041b847eb5 15 int b1, b2, b3; // Button presses
congvu 0:24041b847eb5 16 double ax, ay, az; // Accelerometer readings
congvu 0:24041b847eb5 17 };
congvu 0:24041b847eb5 18
congvu 0:24041b847eb5 19 /**
congvu 0:24041b847eb5 20 * Initialize all the hardware.
congvu 0:24041b847eb5 21 */
congvu 0:24041b847eb5 22 int hardware_init();
congvu 0:24041b847eb5 23
congvu 0:24041b847eb5 24 /**
congvu 0:24041b847eb5 25 * Read all the user inputs.
congvu 0:24041b847eb5 26 * This is all input hardware interaction should happen.
congvu 0:24041b847eb5 27 * Returns a GameInputs struct that has all the inputs recorded.
congvu 0:24041b847eb5 28 * This GameInputs is used elsewhere to compute the game update.
congvu 0:24041b847eb5 29 */
congvu 0:24041b847eb5 30 GameInputs read_inputs();
congvu 0:24041b847eb5 31
congvu 0:24041b847eb5 32 #endif // HARDWARE_H