テスト

Dependencies:   C12832 USBHost mbed MMA7660 wave_player

Fork of app-board-Speaker by Ryohei Funakoshi

Revision:
11:5e85ab7d4176
Parent:
10:5fb0cef92e1b
Child:
12:c1148331b151
diff -r 5fb0cef92e1b -r 5e85ab7d4176 main.cpp
--- a/main.cpp	Sun Dec 11 09:40:13 2016 +0000
+++ b/main.cpp	Mon Dec 12 07:02:14 2016 +0000
@@ -29,6 +29,7 @@
 PwmOut led3(p25);
 Semaphore three_slots(1);
 Timer for_chat;
+AnalogIn mypotentiometer(p19);
 
 //for acceleration sonsor
 MMA7660 acc(p28, p27);
@@ -288,6 +289,20 @@
     }
 } 
 
+void disp_thread(void const *argument) 
+{
+    float mpmeter;
+    while (true) 
+    {
+        mpmeter = mypotentiometer.read();
+        //wait(mpmeter);
+        lcd.locate(0,10);
+        lcd.printf("mpmeter = %f", mpmeter);
+        //wait(mpmeter);
+        //Thread::wait(10);
+    }
+} 
+
 int main() 
 {
     wait(0.01);
@@ -298,7 +313,8 @@
     //Thread thread2(g_thread,(void *)"Th 2");
     //Thread thread3(b_thread,(void *)"Th 3");
     //Thread thread4(count_thread,(void *)"Th 4");
-    Thread thread5(acc_thread,(void *)"Th 5");
+    //Thread thread5(acc_thread,(void *)"Th 5");
+    Thread thread6(disp_thread, (void *)"Th 6");
 
     //for USB
     USBHostMSD msd("usb");
@@ -309,8 +325,8 @@
     
     //for music file
     FILE *wave_file;
-    sp1.period(1.0 / 400000.0);
-    wave_file = fopen("/usb/sample.wav", "r");
+    //sp1.period(1.0 / 400000.0);
+    wave_file = fopen("/usb/music/BGMforMBED2-lowQ.wav", "r");
     waver.play(wave_file);
     fclose(wave_file);