BluetoothHc05 + wtv020sd16p

Dependencies:   TextLCD WTV020SD_Sound_Breakout_Library mbed

main.cpp

Committer:
Mattinico
Date:
2016-11-21
Revision:
0:349db9f6bfd6

File content as of revision 0:349db9f6bfd6:

#include "mbed.h" 
#include "soundboard.h"
#include "TextLCD.h"
Serial pc (SERIAL_TX, SERIAL_RX);  
RawSerial hc05(D8, D10);
soundboard mySoundBoard(D1, D2, D3, D4);
TextLCD lcd(D12, D11, D5, D6, D7, D9)



int main() { 
    char a; 
    pc.baud(9600); // setto il baud rate della porta seriale pc 
    hc05.baud(9600); // setto il baud rate della porta rawserial hc05 
    
    while(1){
        if(hc05.readable ()){
            a=hc05.getc();
            switch (a){
                case '1': {
                    lcd.printf("Traccia 1\n");
                    msb.playAsync(0);
                    break;
                    }
                case '2':{
                    lcd.printf("Traccia 2\n");
                    msb.playAsync(1);
                    break;
                    }
                case '3':{
                    lcd.printf("Traccia 3\n");
                    msb.playAsync(2);
                    break;
                    }
            }
        }
}