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.
Revision 0:488958bde8a0, committed 2010-01-03
- Comitter:
- akumpf
- Date:
- Sun Jan 03 04:25:49 2010 +0000
- Commit message:
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
diff -r 000000000000 -r 488958bde8a0 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Jan 03 04:25:49 2010 +0000
@@ -0,0 +1,51 @@
+#include "mbed.h"
+
+PwmOut myled1(LED1);
+PwmOut myled2(LED2);
+PwmOut myled3(LED3);
+PwmOut myled4(LED4);
+
+// Knight Rider lights.
+// Smoothly transistion between the 4 LEDs to test out the mbed. :)
+int main() {
+ float rate = 0.002;
+ float endHangtime = 0.1;
+ float brightness = 0.9;
+ int i = 0;
+ while(1) {
+ for(i=0; i<=100; i++){
+ myled1 = (100-i)/100.0*brightness;
+ myled2 = i/100.0*brightness;
+ wait(rate);
+ }
+ for(i=0; i<=100; i++){
+ myled2 = (100-i)/100.0*brightness;
+ myled3 = i/100.0*brightness;
+ wait(rate);
+ }
+ for(i=0; i<=100; i++){
+ myled3 = (100-i)/100.0*brightness;
+ myled4 = i/100.0*brightness;
+ wait(rate);
+ }
+ // all the way to one side, briefly pause to exagerate.
+ wait(endHangtime);
+ for(i=0; i<=100; i++){
+ myled4 = (100-i)/100.0*brightness;
+ myled3 = i/100.0*brightness;
+ wait(rate);
+ }
+ for(i=0; i<=100; i++){
+ myled3 = (100-i)/100.0*brightness;
+ myled2 = i/100.0*brightness;
+ wait(rate);
+ }
+ for(i=0; i<=100; i++){
+ myled2 = (100-i)/100.0*brightness;
+ myled1 = i/100.0*brightness;
+ wait(rate);
+ }
+ // all the way to other side, briefly pause to exagerate.
+ wait(endHangtime);
+ }
+}
diff -r 000000000000 -r 488958bde8a0 mbed.bld --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Sun Jan 03 04:25:49 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0