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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 3:c9b8b2a4d481
- Parent:
- 2:913f33d69e70
- Child:
- 4:a3ec775f889b
--- a/main.cpp Thu Dec 10 14:47:20 2015 +0000
+++ b/main.cpp Thu Dec 10 14:51:21 2015 +0000
@@ -1,17 +1,18 @@
#include "mbed.h"
int main()
{
- DigitalOut led(LED1);
+ DigitalOut led(LED1);
DigitalIn sw(p5);
- sw.mode(PullUp);
- float ts=0.5;
- while(1) {
- led = 1;
- wait(ts);
- led = 0;
- wait(ts);
- if (sw==1) {
- ts=ts/2.0;
+ sw.mode(PullUp);
+ int counter=0;
+ while(1)
+ {
+ if (sw==1)
+ {
+ counter++;
}
- }
- }
\ No newline at end of file
+ if((counter%9)==0){
+ led = 1;
+ }
+ }
+ }
\ No newline at end of file