adfdadf

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

Fork of rtos_mutex by mbed official

Files at this revision

API Documentation at this revision

Comitter:
ashea6
Date:
Fri Feb 26 18:36:22 2016 +0000
Parent:
6:91595eac48f4
Child:
8:ba3c6765eba3
Commit message:
update;

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Fri Feb 26 18:05:50 2016 +0000
+++ b/main.cpp	Fri Feb 26 18:36:22 2016 +0000
@@ -39,21 +39,27 @@
 */
 
 void wav_thread(void const *args) {
-    FILE *wave_file;
-    printf("\n\n\nHello, wave world!\n");
-    wave_file=fopen("/sd/beethoven.wav","r");
-    //while(1){
-       waver.play(wave_file);
-    //}
-    fclose(wave_file);
+    while(1) {
+        FILE *wave_file;
+        printf("\n\n\nHello, wave world!\n");
+        wave_file=fopen("/sd/beethoven.wav","r");
+        if (wave_file) {
+            printf("wave file found");
+            }
+        else {
+            printf("file not found");
+            }
+        waver.play(wave_file);
+        fclose(wave_file);
+        Thread::wait(1000);
+    }
 }
 
 void shift_thread(void const *args){
-
-int r,g,b;
-r=g=b=50;
     
+    int r,g,b;
     while(1) {
+        r=g=b=50;
         myBrite.Write(255,255,255);
         Thread::wait(500);
         myBrite.Write(0,0,255);
@@ -88,27 +94,26 @@
     stdio_mutex.unlock();
 }
 
-void test_thread(void const *args) {
+/*void test_thread(void const *args) {
     while (true) {
         notify((const char*)args, 0); Thread::wait(1000);
         notify((const char*)args, 1); Thread::wait(1000);
     }
-}
+}*/
 
 int main() {
-    Thread wav_thread(wav_thread);
+    Thread audio(wav_thread);
     Thread thread(led2_thread);
-    Thread shift_thread(shift_thread);
-
+    Thread lighting(shift_thread);
     
     while (true) {
         led1 = !led1;
         Thread::wait(500);
-        }
+    }
         
-    Thread t2(test_thread, (void *)"Th 2");
-    Thread t3(test_thread, (void *)"Th 3");
+    //Thread t2(test_thread, (void *)"Th 2");
+    //Thread t3(test_thread, (void *)"Th 3");
     
-    test_thread((void *)"Th 1");
+    //test_thread((void *)"Th 1");
     
 }