A game for Lab 4 of ECE 4180

Dependencies:   4DGL-uLCD-SE LSM9DS1_Library SDFileSystem mbed-rtos mbed wave_player

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers InputHandler.h Source File

InputHandler.h

00001 #ifndef _InputHandler_H_
00002 #define _InputHandler_H_
00003 
00004 #include "LSM9DS1.h"
00005 #include "mbed.h"
00006 #include "rtos.h"
00007 
00008 class InputHandler
00009 {
00010     public:
00011         InputHandler(PinName sda, PinName scl, uint8_t xgAddr, uint8_t mAddr, PinName dio);
00012     
00013         float getXAccel();
00014         float getYAccel();
00015         float getZAccel();
00016         bool  getPushed();
00017         
00018         Thread* start();
00019     
00020     private:
00021         static void threadStarter(void const *p);
00022         void retrieveInputs();
00023         
00024         LSM9DS1 imu;
00025         DigitalIn pushButton;
00026         float xAccel;
00027         float yAccel;
00028         float zAccel;
00029         bool isPushed;
00030         
00031         Mutex stdio_mutex;
00032 };        
00033 
00034 #endif