PROGRAMMA FINALE

Dependencies:   TextLCD WTV020SD_Sound_Breakout_Library mbed

Files at this revision

API Documentation at this revision

Comitter:
Mattinico
Date:
Tue Jan 31 18:36:30 2017 +0000
Commit message:
k;

Changed in this revision

TextLCD.lib Show annotated file Show diff for this revision Revisions of this file
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 69cd3cb5e75f TextLCD.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/TextLCD.lib	Tue Jan 31 18:36:30 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/MEM/code/TextLCD/#308d188a2d3a
diff -r 000000000000 -r 69cd3cb5e75f WTV020SD_Sound_Breakout_Library.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/WTV020SD_Sound_Breakout_Library.lib	Tue Jan 31 18:36:30 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/ejteb/code/WTV020SD_Sound_Breakout_Library/#d6b7b90b4387
diff -r 000000000000 -r 69cd3cb5e75f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Tue Jan 31 18:36:30 2017 +0000
@@ -0,0 +1,79 @@
+#include "mbed.h" 
+#include "TextLCD.h"
+#include "soundboard.h"
+Serial pc (SERIAL_TX, SERIAL_RX);  
+RawSerial hc05(D8, D2);
+TextLCD lcd(D12, D11, D6, D4, D14, D15);// rs, e, d4-d7 
+soundboard msb(D3,D5,D7,D9);//1, 7, 10, 15
+//8GND, 4-5cassa, 163V3 
+
+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_7);
+    lcd.cls();
+    lcd.locate(0,0);
+    lcd.printf("Cassa\n");
+    while(1){   
+         if(hc05.readable ()){
+            a=hc05.getc();
+            
+            switch (a){
+                case '1': {
+                    lcd.cls();
+                    lcd.locate(0,0);
+                    lcd.printf("Song: Narcos");
+                    msb.playAsync(0);
+                    break;
+                    }
+                case '2':{
+                    lcd.cls();
+                    lcd.locate(0,0);
+                    lcd.printf("Song: Aria");
+                    msb.playAsync(1);
+                    break;
+                    }
+                case '3':{
+                    lcd.cls();
+                    lcd.locate(0,0);
+                    lcd.printf("Song: Simon says");
+                    msb.playAsync(2);
+                    break;
+                    }
+                case '4': {
+                    lcd.cls();
+                    lcd.locate(0,0);
+                    lcd.printf("Song: Curnuton");
+                    msb.playAsync(3);
+                    break;
+                    }
+            }
+        }
+         if(hc05.readable ()){
+             b=hc05.getc();
+             switch (b){
+                 case '-':{
+                    lcd.locate(0,1);
+                     lcd.printf("Volume: 20/100");
+                     msb.setVolume(VOL_5-0x0002);
+                     break;
+                    }
+                case '+':{
+                  lcd.locate(0,1);
+                 lcd.printf("Volume: 90/100");
+                 msb.setVolume(VOL_4+0x0002);
+                 break;
+                }
+                case '/':{
+                  lcd.locate(0,1);
+                 lcd.printf("Volume: 60/100");
+                 msb.setVolume(VOL_4);
+                 break;
+                }
+                
+            }
+            }    
+}  
+}    
\ No newline at end of file
diff -r 000000000000 -r 69cd3cb5e75f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Tue Jan 31 18:36:30 2017 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/d75b3fe1f5cb
\ No newline at end of file