Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 14:839ab5f50d40
- Parent:
- 12:60c531df03fd
- Child:
- 16:8ae70f0b8fca
--- a/main.cpp Wed Oct 12 10:55:59 2016 +0000 +++ b/main.cpp Fri Mar 03 11:48:32 2017 +0000 @@ -1,4 +1,4 @@ -#include "LaLaBox.h" +#include "Crealab.h" Serial pc_uart(PA_2, PA_3); Serial bt_uart(PA_9, PA_10); @@ -43,6 +43,7 @@ motorBox.Stop(); motorDancer.Stop(); ledBand.ResetColor(); + buzzer.stopPlay(); } void pressed() { @@ -72,8 +73,8 @@ ledBand.StopRotation(); ledBand.ResetColor(); ledBand.InsertColorNtimes(3,BLUE,20.0); - ledBand.InsertColorNtimes(1,WHITE); - ledBand.InsertColorNtimes(4,RED,50.0); + ledBand.InsertColorNtimes(1,WHITE,20.0); + ledBand.InsertColorNtimes(4,RED,20.0); ledBand.StartRotation(0.1); // PLAY_MUSIC(song_happy_birthday, buzzer); break; @@ -114,6 +115,7 @@ wait(2); // Some delay myled = 0; // Real stuff starts here DEBUG("Enter a command : \n\r", SystemCoreClock); + ledBand.SetColor(WHITE); while(1) { char command; // Command to execute @@ -139,9 +141,9 @@ CASE('r', "Music 5", PLAY_MUSIC(song_happy_birthday,buzzer); ) CASE('l', "Light ", ledBand.StopRotation(); ledBand.ResetColor(); - ledBand.InsertColorNtimes(3,BLUE,20.0); - ledBand.InsertColorNtimes(1,WHITE); - ledBand.InsertColorNtimes(4,RED,50.0); + ledBand.InsertColorNtimes(3,YELLOW,5.0); + ledBand.InsertColorNtimes(1,PURPLE,5); + ledBand.InsertColorNtimes(4,GREEN,10.0); ledBand.StartRotation(0.1); )