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:
- 7:592af6237038
- Parent:
- 6:2f4867594333
- Child:
- 8:fb28b9ec6d6e
diff -r 2f4867594333 -r 592af6237038 main.cpp
--- a/main.cpp Tue Aug 23 11:34:10 2016 +0000
+++ b/main.cpp Wed Aug 24 21:12:30 2016 +0000
@@ -18,7 +18,7 @@
Motor motorDancer(PA_8, PB_10, PB_4, PB_5, 10000);
// PIN & number of LEDS. Available color ==> BLUE, LIGHTBLUE, RED, GREEN, BLACK, WHITE, PURPLE, PINK, YELLOW
-LED_WS2812 ledBand(D3,16);
+LED_WS2812 ledBand(D3,8);
// --- Define PC_8 as the output of PWM use for Tones -----
Buzzer buzzer(PC_8);
@@ -57,33 +57,35 @@
case 2:
motorDancer.RunDegrees(CLOCKWISE, (float)180.0);
motorBox.RunDegrees(COUNTERCLOCKWISE, (float)180.0);
- ledBand.SetColor(0xFF00FF);
+ ledBand.SetColor(0x0000FF);
ledBand.SetIntensity(50.0);
break;
case 3:
- ledBand.InsertColor(BLUE);
- ledBand.InsertColor(WHITE);
- ledBand.InsertColor(RED);
+ ledBand.InsertColor(BLUE);
+ ledBand.InsertColor(WHITE);
+ ledBand.InsertColor(RED);
break;
- case 4:
- ledBand.StartRotation(0.1);
+ case 4:
+ ledBand.StartRotation(1);
break;
case 5:
- ledBand.ResetColor();
- ledBand.InsertColorNtimes(5,BLUE);
- ledBand.InsertColorNtimes(2,WHITE);
- ledBand.InsertColorNtimes(5,RED,50.0);
- ledBand.StartRotation(0.01);
+ ledBand.StopRotation();
+ ledBand.ResetColor();
+ ledBand.InsertColorNtimes(3,BLUE);
+ ledBand.InsertColorNtimes(1,WHITE);
+ ledBand.InsertColorNtimes(4,RED,50.0);
+ ledBand.StartRotation(0.1);
PLAY_MUSIC(song_happy_birthday, buzzer);
break;
default:
- ledBand.StopRotation(0.1);
+ ledBand.StopRotation();
motorDancer.Stop();
motorBox.Stop();
state = 0;
- myled = !myled; // To see something is alive
- break;
+ break;
}
+ myled = !myled; // To see something is alive
+
}
int main() {