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.
Fork of Nucleo_blink_led by
Diff: main.cpp
- Revision:
- 1:08f0b72c9643
- Parent:
- 0:c4ef4204ae76
- Child:
- 2:3bbbc40b8449
--- a/main.cpp Thu Apr 23 17:26:08 2015 +0000
+++ b/main.cpp Sun Apr 26 09:37:58 2015 +0000
@@ -1,16 +1,51 @@
#include "mbed.h"
DigitalOut myled(LED1);
-unsigned char i;
+DigitalIn mybutton(USER_BUTTON);
+int i=250;
int main()
{
- while(1) {
+ while(1)
+ {
+ if (mybutton ==0)
+ switch (i)
+ {
+ case 250:
+ i=500;
+ break;
+
+ case 500:
+ i=750;
+ break;
+
+
+
+ case 750:
+ i=1000;
+ break;
+
+ case 1000:
+ i=1250;
+ break;
+
+ case 1250:
+ i=1500;
+ break;
+
+ case 1500:
+ i=250;
+ break;
+
+ default:
+ i=250;
+ break;
+ }
+
myled = 1; // LED is ON
wait_ms(i); // in ms
myled = 0; // LED is OFF
wait_ms(i); // in ms
- //wait(0.2); // 200 msec
- i=i++;
+
}
}
