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:
- 1:0072ef0302ec
- Parent:
- 0:76669ad2c30b
- Child:
- 2:14b38579386c
--- a/main.cpp Wed Nov 26 09:31:01 2014 +0000
+++ b/main.cpp Wed Nov 26 09:53:44 2014 +0000
@@ -9,7 +9,7 @@
bool longPress = false;
int counterTime = 0;
-int counterBlink=4;
+int counterBlink=8;
Ticker timeTasterTest;
Ticker timeLedTest;
@@ -19,25 +19,33 @@
int main()
{
+ timeTasterTest.attach(&tasterTest,0.01);
+ timeLedTest.attach(&ledTest,0.5);
+
while(1) {
- timeTasterTest.attach(&tasterTest,0.01);
- timeLedTest.attach(&ledTest,0.5);
+
+
}
}
void ledTest()
{
if(shortPress) {
- if(counterBlink>=0) {
- led[1]=!led[1];
+ if(counterBlink>0) {
+ led[3]=!led[3];
counterBlink--;
} else {
- led[1]=0;
- counterBlink=4;
+ led[3]=0;
+ counterBlink=8;
+ shortPress=false;
}
}
if(longPress) {
- led[1]=!led[1];
+ led[3]=!led[3];
+ }
+
+ if(!longPress&&!shortPress) {
+ led[3]=0;
}
}