Cong Vu / Mbed 2 deprecated Project2_cvu31

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers hardware.h Source File

hardware.h

00001 // Copyright 2020 Georgia Tech.  All rights reserved.
00002 // The materials provided by the instructor in this course are for
00003 // the use of the students currently enrolled in the course.
00004 // Copyrighted course materials may not be further disseminated.
00005 // This file must not be made publicly available anywhere.
00006 
00007 #ifndef HARDWARE_H
00008 #define HARDWARE_H
00009 
00010 /**
00011  * Structure that represents all the inputs to the game.
00012  * If additional hardware is added, new elements should be added to this struct.
00013  */
00014 struct GameInputs {
00015     int b1, b2, b3;     // Button presses
00016     double ax, ay, az;  // Accelerometer readings
00017 };
00018 
00019 /**
00020  * Initialize all the hardware.
00021  */
00022 int hardware_init();
00023 
00024 /**
00025  * Read all the user inputs. 
00026  * This is all input hardware interaction should happen.
00027  * Returns a GameInputs struct that has all the inputs recorded.
00028  * This GameInputs is used elsewhere to compute the game update.
00029  */
00030 GameInputs read_inputs();
00031 
00032 #endif // HARDWARE_H