Undertale

Dependencies:   mbed wave_player 4DGL-uLCD-SE MMA8452

Revision:
2:3caab2cc0476
Parent:
1:399033d39feb
Child:
3:ab8f2b4b44b0
--- a/hardware.cpp	Wed Apr 04 21:11:07 2018 +0000
+++ b/hardware.cpp	Thu Apr 11 18:13:32 2019 +0000
@@ -32,12 +32,19 @@
     button1.mode(PullUp); 
     button2.mode(PullUp);
     button3.mode(PullUp);
-    
+    acc.activate();
     return ERROR_NONE;
 }
 
 GameInputs read_inputs() 
 {
     GameInputs in;
+    
+    in.b1 = button1; // top button
+    in.b2 = button2; // second button 
+    in.b3 = button3; // third button
+    acc.readXGravity(&in.ax); // x axis acce
+    acc.readYGravity(&in.ay); // y axis acce
+    acc.readZGravity(&in.az); // z axis acce
     return in;
 }