Cassa bluetooth con modulo wtv020sd-16p

Dependencies:   WTV020SD_Sound_Breakout_Library mbed

Fork of Progetto_finale_noLCD by Mattia Nicosia

Files at this revision

API Documentation at this revision

Comitter:
Mattinico
Date:
Sat Nov 26 13:57:50 2016 +0000
Commit message:
k

Changed in this revision

WTV020SD_Sound_Breakout_Library.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r d760fe3f3304 WTV020SD_Sound_Breakout_Library.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WTV020SD_Sound_Breakout_Library.lib	Sat Nov 26 13:57:50 2016 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/ejteb/code/WTV020SD_Sound_Breakout_Library/#d6b7b90b4387
diff -r 000000000000 -r d760fe3f3304 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Nov 26 13:57:50 2016 +0000
@@ -0,0 +1,81 @@
+#include "mbed.h" 
+#include "soundboard.h"
+Serial pc (USBTX, USBRX);  
+RawSerial hc05(D8, D2);
+soundboard msb(D3, D5, D7, D9);//1, 7, 10, 15
+//8GND, 4-5cassa, 163V3
+DigitalOut l1(D15);
+DigitalOut l2(D14);
+DigitalOut l3(D12);
+
+int main() { 
+    
+    char a;
+    char b;
+    pc.baud(9600); // setto il baud rate della porta seriale pc 
+    hc05.baud(9600);// setto il baud rate della porta rawserial hc05
+   msb.setVolume(VOL_5);
+   l1=1; l2=1; l3=0;
+    while(1){
+          
+         if(hc05.readable ()){
+             b=hc05.getc();
+             switch (b){
+                 case '-':{
+                     pc.printf("MIN\n\r");
+                     msb.setVolume(VOL_5-0x0002);
+                    l1=1; l2=0; l3=0;
+                     break;
+                    }
+                case '+':{
+                 pc.printf("MAX\n\r");
+                 msb.setVolume(VOL_5+0x0002);
+                 l1=1; l2=1; l3=1;
+                 break;
+                }
+                case 's':{
+                 pc.printf("Volume 5\n\r");
+                 msb.setVolume(VOL_5);
+                 l1=1; l2=1; l3=0;
+                 break;
+                }
+                
+            }
+            }
+                    
+         if(hc05.readable ()){
+            a=hc05.getc();
+            switch (a){
+                case '1': {
+                    pc.printf("Traccia 1\n\r");
+                    msb.playAsync(0);
+                    
+                    break;
+                    }
+                case '2':{
+                    pc.printf("Traccia 2\n\r");
+                    msb.playAsync(1);
+                    break;
+                    }
+                case '3':{
+                    pc.printf("Traccia 3\n\r");
+                    msb.playAsync(2);
+                    break;
+                    }
+                case '4': {
+                    pc.printf("Traccia 4\n\r");
+                    msb.playAsync(3);
+                    
+                    break;
+                    }
+                case 'p': {
+                    pc.printf("PAUSA\n\r");
+                    msb.pause();
+                    
+                    break;
+                    }
+            }
+        }
+         
+}  
+}       
\ No newline at end of file
diff -r 000000000000 -r d760fe3f3304 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Nov 26 13:57:50 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb
\ No newline at end of file