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:c606bb1acbdc, committed 2010-10-29
- Comitter:
- daniogenes
- Date:
- Fri Oct 29 18:55:33 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 |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Oct 29 18:55:33 2010 +0000
@@ -0,0 +1,45 @@
+#include "mbed.h"
+
+// a flashlight with 4 Leds like the KID in Nightrider
+
+PwmOut led_1(LED1);
+PwmOut led_2(LED2);
+PwmOut led_3(LED3);
+PwmOut led_4(LED4);
+
+int main() {
+
+float
+q;
+
+ while(1) {
+ for(float p = 0.0f; p < 4.0f; p += 0.1f) {
+ led_1 = p;
+ led_2 = p-1.0;
+ led_3 = p-2.0;
+ led_4 = p-3.0;
+ wait(0.01);
+ }
+ for(float p = 4.0f; p > 0.0f; p -= 0.1f) {
+ led_4 = p;
+ led_3 = p-1.0;
+ led_2 = p-2.0;
+ led_1 = p-3.0;
+ wait(0.01);
+ }
+ for(float p = 0.0f; p < 4.0f; p += 0.1f) {
+ led_4 = p;
+ led_3 = p-1.0;
+ led_2 = p-2.0;
+ led_1 = p-3.0;
+ wait(0.01);
+ }
+ for(float p = 4.0f; p > 0.0f; p -= 0.1f) {
+ led_1 = p;
+ led_2 = p-1.0;
+ led_3 = p-2.0;
+ led_4 = p-3.0;
+ wait(0.01);
+ }
+ }
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Fri Oct 29 18:55:33 2010 +0000 @@ -0,0 +1,1 @@ +http://mbed.org/users/mbed_official/code/mbed/builds/e2ac27c8e93e