hey

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

Fork of 4180_Lab4_v6 by Scott Williams

Revision:
2:68c4e1539da5
Parent:
1:abd7e0631db8
--- a/main.cpp	Mon Oct 31 19:52:09 2016 +0000
+++ b/main.cpp	Mon Oct 31 20:52:10 2016 +0000
@@ -23,6 +23,7 @@
 bool Alive = 1;
 bool Drown = 0;
 bool Splat = 0;
+bool Victory = 0;
 double CarWidth = 10;
 int i = 11;
 int j = 11;
@@ -191,10 +192,21 @@
         uLCD.printf("SPLAT!");
         stdio_mutex.unlock();
         
-        //FILE *wave_file;
-        //wave_file=fopen("/sd/Splat.wav","r");
-        //waver.play(wave_file);
-        //fclose(wave_file);
+        FILE *wave_file;
+        wave_file=fopen("/sd/Splat.wav","r");
+        waver.play(wave_file);
+        fclose(wave_file);
+        }
+         if(Victory == 1){
+        stdio_mutex.lock();
+        uLCD.locate(1,1);
+        uLCD.printf("Victory!");
+        stdio_mutex.unlock();
+        
+        FILE *wave_file;
+        wave_file=fopen("/sd/Victory.wav","r");
+        waver.play(wave_file);
+        fclose(wave_file);
         }
     Thread::wait(10);
     }