Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: 4DGL-uLCD-SE PinDetect mbed SparkfunAnalogJoystick mbed-rtos
Fork of ECE2036Lab2StarterCode by
Diff: main.cpp
- Revision:
- 7:7f2393b8ba4a
- Parent:
- 6:9cdde66d7502
--- 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
