f

Dependencies:   mbed 4DGL-uLCD-SE MMA8452

Revision:
1:d57364f0349f
Parent:
0:8e3b9bb1084a
Child:
2:ca5910acbade
--- a/main.cpp	Thu Mar 10 05:18:13 2022 +0000
+++ b/main.cpp	Thu Mar 10 05:30:11 2022 +0000
@@ -17,6 +17,21 @@
 #include "graphics.h"
 #include "keyboard.h"
 // ===User implementations start===
+//For sound components
+////AnalogOut DACout(p18);
+//PwmOut pwmout(p26);
+
+////PwmOut speaker(p25); //speaker
+
+
+////wave_player waver(&DACout);
+//SDFileSystem sd(p5, p6, p7, p8, "sd"); // mosi, miso, sck, cs
+// use the above for the wave player
+
+DigitalOut myled1(LED1);
+DigitalOut myled2(LED2);
+DigitalOut myled3(LED3);
+DigitalOut myled4(LED4);
 
 void set_random_seed(Timer);
 
@@ -28,10 +43,42 @@
 */
 int main()
 {
-// ===User implementations end===
+    
+    GameInputs inputs; 
+    // First things first: initialize hardware
+    ASSERT_P(hardware_init() == ERROR_NONE, "Hardware init failed!");
+    pc.printf("Program Starting\n");
+    //led1 hardware initialization
+    
+    myled1=1;  
+    Timer t;
+    int dt; // delta time
+    
+/*
+Put your code for main menu here, seed random function here as well
+*/
+
+// initialize the game state, print something to the screen and wait for an input.
+// do that before entering this game loop
+
+while(1){
+        t.start(); //start a timer
+        draw_lower_status(); //draw the lower status bar
+        inputs = read_inputs(); //read the inputs of the game
+        
+        
+        /*
+        your code here, make decisions based on those inputs, update the keyboard
+        make selections, update words etc.
+        */
+        
+        t.stop();
+        dt = t.read_ms();
+        
+        }
 }
 
-// ===User implementations start===
+
 
 /*
 * This function sets the random seed for the game.