eLab Team / Mbed 2 deprecated LaLaBox

Dependencies:   mbed CREALIB

Revision:
12:60c531df03fd
Parent:
11:c0728c05f977
Child:
13:3b05cd187c41
Child:
14:839ab5f50d40
--- a/main.cpp	Tue Oct 11 22:22:27 2016 +0000
+++ b/main.cpp	Wed Oct 12 10:55:59 2016 +0000
@@ -1,5 +1,6 @@
 #include "LaLaBox.h"
 Serial pc_uart(PA_2, PA_3);
+Serial bt_uart(PA_9, PA_10);
 
 // ---------------- Local global variables --------------
     
@@ -97,10 +98,10 @@
     DEBUG("------------------------------------------\n\r"); 
     DEBUG("----- LaLaBox (CreaLab)     version 1.0 ----\n\r");
     DEBUG("------------------------------------------\n\r"); 
-    help();
+   // help();
     DEBUG("------------------------------------------\n\r"); 
      ledBand.SetColor(BLACK);
-    DEBUG("SystemCoreClock = %d Hz = %f\n\r", SystemCoreClock); 
+    DEBUG("SystemCoreClock = %d Hz =\n\r", SystemCoreClock); 
 
    CATCH_BUTTON(myButton,clicked);
    CATCH_BUTTON(buttonBox,clicked);
@@ -108,20 +109,21 @@
    buttonBox.rise(&clicked);
     
  //   PLAY_NOTE(la, buzzer);             
+   DEBUG("Wait 2s\n\r", SystemCoreClock); 
 
     wait(2);        // Some delay
     myled = 0;      // Real stuff starts here
+   DEBUG("Enter a command : \n\r", SystemCoreClock); 
 
    while(1) {
         char command;   // Command to execute
         DEBUG(">> ");
-        command = pc_uart.getc();
+        command = bt_uart.getc();
         DEBUG("%c", command);
         flaghelp = false;
         switch (command) {
         case 'h':    
-            DEBUG("List of commands:\n\r");
-            DEBUG(" h --> Help, display list of cammands\n\r");
+            help();
             flaghelp=true;
         CASE('o', "OpenBox", motorBox.RunDegrees(COUNTERCLOCKWISE, (float)60.0);    )   
         CASE('c', "CloseBox", motorBox.RunDegrees(CLOCKWISE, (float)60.0);    )   
@@ -130,6 +132,11 @@
         CASE('f', "Dancer Clock Wise ", motorDancer.RunInfinite(CLOCKWISE);    )   
         CASE('j', "Dancer Counter Clock Wise ", motorDancer.RunInfinite(COUNTERCLOCKWISE);    )   
         CASE('s', "STOP ", clicked();   )   
+        CASE('m', "Music 1", PLAY_MUSIC(song_xfile,buzzer);   )   
+        CASE('n', "Music 2", PLAY_MUSIC(song_lightmyfire,buzzer);   )   
+        CASE('p', "Music 3", PLAY_MUSIC(song_greensleaves,buzzer);   )   
+        CASE('q', "Music 4", PLAY_MUSIC(song_christmas,buzzer);   )   
+        CASE('r', "Music 5", PLAY_MUSIC(song_happy_birthday,buzzer);   )   
         CASE('l', "Light ", 
            ledBand.StopRotation(); ledBand.ResetColor();
            ledBand.InsertColorNtimes(3,BLUE,20.0);