ECE 2035 final project

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Revision:
2:22d36e7740f1
Parent:
1:399033d39feb
--- a/hardware.cpp	Wed Apr 04 21:11:07 2018 +0000
+++ b/hardware.cpp	Mon Apr 15 12:25:08 2019 +0000
@@ -10,7 +10,7 @@
 
 // Hardware initialization: Instantiate all the things!
 uLCD_4DGL uLCD(p9,p10,p11);             // LCD Screen (tx, rx, reset)
-//SDFileSystem sd(p5, p6, p7, p8, "sd");  // SD Card(mosi, miso, sck, cs)
+SDFileSystem sd(p5, p6, p7, p8, "sd");  // SD Card(mosi, miso, sck, cs)
 Serial pc(USBTX,USBRX);                 // USB Console (tx, rx)
 MMA8452 acc(p28, p27, 100000);        // Accelerometer (sda, sdc, rate)
 DigitalIn button1(p21);                 // Pushbuttons (pin)
@@ -39,5 +39,13 @@
 GameInputs read_inputs() 
 {
     GameInputs in;
+    in.b1 = button1;
+    in.b2 = button2;
+    in.b3 = button3;
+    if(!acc.isXYZReady()) 
+      {
+         wait(0.01);
+      }
+    acc.readXYZGravity(&in.ax, &in.ay, &in.az);
     return in;
 }