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:
- 0:38eeebe6f17e
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Fri Jul 16 17:49:54 2010 +0000
@@ -0,0 +1,55 @@
+#include "mbed.h"
+
+PwmOut led1(LED1);
+PwmOut led2(LED2);
+PwmOut led3(LED3);
+PwmOut led4(LED4);
+
+int main() {
+ while (1) {
+ for (float p = 0.01f; p < 0.999f; p += 0.01f) {
+ led1 = p;
+ wait(0.01);
+ }
+ for (float p = 0.999f; p > 0.01f; p -= 0.01f) {
+ led1 = p;
+ wait(0.01);
+ }
+
+ wait(2);
+
+ for (float p = 0.01f; p < 0.999f; p += 0.01f) {
+ led2 = p;
+ wait(0.01);
+ }
+ for (float p = 0.999f; p > 0.01f; p -= 0.01f) {
+ led2 = p;
+ wait(0.01);
+ }
+
+ wait(2);
+
+ for (float p = 0.01f; p < 0.999f; p += 0.01f) {
+ led3 = p;
+ wait(0.01);
+ }
+ for (float p = 0.999f; p > 0.01f; p -= 0.01f) {
+ led3 = p;
+ wait(0.01);
+ }
+
+ wait(2);
+
+ for (float p = 0.01f; p < 0.999f; p += 0.01f) {
+ led4 = p;
+ wait(0.01);
+ }
+ for (float p = 0.999f; p > 0.01f; p -= 0.01f) {
+ led4 = p;
+ wait(0.01);
+ }
+
+ wait(2);
+
+ }
+}
\ No newline at end of file