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:
- 12:cce8984e5569
- Parent:
- 9:c3d4c7059979
- Child:
- 13:db79286e7ce6
diff -r c3d4c7059979 -r cce8984e5569 main.cpp
--- a/main.cpp Sat Sep 21 21:26:02 2013 +0000
+++ b/main.cpp Sun Sep 22 15:00:26 2013 +0000
@@ -416,13 +416,13 @@
return;
}
strip[led_] = getcolor(a_, b_);
- led_ += stride_;
if (fast_) {
strip[led_] |= FAST;
time_ += 128;
} else {
- time_ += 256;
+ time_ += 257;
}
+ led_ += stride_;
strip_changed = true;
Schedule(this);
}
@@ -436,13 +436,17 @@
class MorseGoogleProgram : public Schedulable {
public:
+ MorseGoogleProgram() {
+ supervisor.RegisterProgram(this);
+ }
+
virtual void Run() {
- const string code = "W.... .- .--. .--. -.-- / -... .. .-. - .... -.. .- -.-- --..-- / B--. R--- Y--- B--. G.-.. R. ";
+ const string code = "M.... .- .--. .--. -.-- / -... .. .-. - .... -.. .- -.-- --..-- / B--. R--- Y--- B--. G.-.. R. ";
const int kSpaceTime = 3*256;
const int kLedStart = 150;
const int kStride = -2;
- const int kHalfStrideTime = 64;
- const int kDotSpaceTime = 256;
+ const int kHalfStrideTime = 65;
+ const int kDotSpaceTime = 257;
int time = global_tick;
uint8_t color = WHITE;
for (int i = 0; i < code.size(); i++) {
@@ -483,6 +487,19 @@
ProgramWatchdog finaliser_;
};
+class PrintFProgram : public Schedulable {
+public:
+ PrintFProgram() {
+ supervisor.RegisterProgram(this);
+ }
+
+ virtual void Run() {
+ strip[20] = strip[50] = strip[100] = RED;
+ strip_changed = true;
+ new WalkingFade(global_tick, 155, -2, 160, BLACK, GREEN, true);
+ new WalkingFade(global_tick+64, 154, -2, 160, BLACK, GREEN, true);
+ }
+};
void init_board()
{
@@ -525,6 +542,7 @@
//MultiDropBucketFillProgram multi_drop;
MorseGoogleProgram morse;
+ //PrintFProgram pr;
supervisor.ScheduleProgram();
