Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: mbed wave_player 4DGL-uLCD-SE MMA8452
hardware.h
- Committer:
- robbiehuey
- Date:
- 2021-04-10
- Revision:
- 2:cf4e61c051a4
- Parent:
- 0:95264f964374
File content as of revision 2:cf4e61c051a4:
#ifndef HARDWARE_H
#define HARDWARE_H
/**
 * Structure that represents all the inputs to the game.
 * If additional hardware is added, new elements should be added to this struct.
 */
struct GameInputs {
    int b1, b2, b3;     // Button presses
    double ax, ay, az;  // Accelerometer readings
};
/**
 * Initialize all the hardware.
 */
int hardware_init();
/**
 * Read all the user inputs. 
 * This is all input hardware interaction should happen.
 * Returns a GameInputs struct that has all the inputs recorded.
 * This GameInputs is used elsewhere to compute the game update.
 */
GameInputs read_inputs();
#endif // HARDWARE_H