4180 Final

Dependencies:   mbed wave_player mbed-rtos 4180Final SDFileSystem

Revision:
13:aff3ad7d5afc
Parent:
12:896de8e66292
Child:
14:c21ffddc6e13
--- a/main.cpp	Wed Apr 29 03:17:15 2020 +0000
+++ b/main.cpp	Wed Apr 29 03:39:11 2020 +0000
@@ -30,8 +30,8 @@
 // Globals
 int rounds = 3;
 int curRound = 1;
-int score1 = 0;
-int score2 = 0;
+volatile int score1 = 0;
+volatile int score2 = 0;
 int scores1[7] = {0};
 int scores2[7] = {0};
 int curTime = 0;
@@ -438,6 +438,7 @@
      uLCD.text_height(4);
      uLCD.text_width(4);
      Thread t1(read_mic);
+     mic.attach(&read_mic, 1.0/8000.0);
      while (1) {
         timer = 0;
         // Blinking pause button
@@ -681,6 +682,7 @@
      thread1.start(pot_thread);
      thread2.start(mic_thread);
      nextsample.attach(&playMenuMusic, 1.0/8000.0);
+     
      while (1) {
          // play music
          playMusic = 1;