Rishi Bhargava / Mbed 2 deprecated 4180FinalLab

Dependencies:   4DGL-uLCD-SE PinDetect mbed SparkfunAnalogJoystick mbed-rtos

Fork of ECE2036Lab2StarterCode by Joseph Lind

Files at this revision

API Documentation at this revision

Comitter:
Mpmart08
Date:
Wed Apr 27 15:23:54 2016 +0000
Parent:
6:9cdde66d7502
Commit message:
stuff

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 9cdde66d7502 -r 7f2393b8ba4a main.cpp
--- a/main.cpp	Tue Apr 26 18:54:13 2016 +0000
+++ b/main.cpp	Wed Apr 27 15:23:54 2016 +0000
@@ -81,6 +81,19 @@
         }
     }
 }
+
+// thread that writes to the sd card
+void sd_card_thread(void const *argument) {
+
+    while (true) {
+        switch (gameState) {
+        case WIN:
+        case LOSE:
+            
+            break;
+        }
+    }
+}
  
 int main() 
 {   
@@ -115,6 +128,7 @@
     }
     
     Thread thread1(speaker_thread);
+    Thread thread2(sd_card_thread);
     
     while (1) 
     {
@@ -191,7 +205,7 @@
                 
                 ball.update();
                 botMove = -joystick.yAxis();
-                if (botMove < -0.25 || botMove > 0.25) {
+                if (botMove < -0.1 || botMove > 0.1) {
                     botPaddle.move(botMove);
                 }
                 //GET OTHER PADDLE SPOT AND UPDATE topPaddle