project for 2035

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Revision:
4:b687219ae447
Parent:
3:9dde875cd65c
Child:
5:cd2bdbfedd21
--- a/hardware.cpp	Tue Nov 24 08:35:47 2020 +0000
+++ b/hardware.cpp	Tue Nov 24 10:26:05 2020 +0000
@@ -31,8 +31,10 @@
 // properly. Do that here.
 int hardware_init()
 {
-    // Crank up the speed
+    // Crank up the speed and init LCD
     uLCD.baudrate(3000000);
+    uLCD.background_color(BLACK);
+    uLCD.cls();
     pc.baud(115200);
         
     //Initialize pushbuttons
@@ -41,7 +43,7 @@
     button3.mode(PullUp);
     
     //Initialize accelerometer
-    accel.init();
+    acc.init();
     
     return ERROR_NONE;
 }
@@ -52,5 +54,11 @@
 GameInputs read_inputs() 
 {
     GameInputs in;
+    in->ax = acc.readX();
+    in->ay = acc.readY();
+    in->az = acc.readZ();
+    in->b1 = button1.read();
+    in->b2 = button2.read();
+    in->b3 = button3.read();
     return in;
 }