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:
- 5:86742cfaf4e4
- Parent:
- 4:728667196916
- Child:
- 6:f475e8557afb
diff -r 728667196916 -r 86742cfaf4e4 main.cpp
--- a/main.cpp Tue Jan 15 10:09:53 2019 +0000
+++ b/main.cpp Thu Jan 30 08:16:04 2020 +0000
@@ -6,7 +6,7 @@
// is pressed
// The callback uses a shared variable to signal another thread
-InterruptIn button(PTD0);
+InterruptIn button(PTD0); // Pin must be on ports A or D
DigitalOut led(LED_GREEN);
volatile int pressEvent = 0 ;
@@ -15,7 +15,7 @@
// Signal that the button has been pressed
// Note: bounce may occur
void buttonCallback(){
- pressEvent = 1 ;
+ pressEvent = 1 ;
}
/* ---- Main function (default thread) ----
@@ -31,6 +31,6 @@
led = !led ;
pressEvent = 0 ; // Clear the event variable
}
- wait(0.1) ;
+ ThisThread::sleep_for(100) ; // delay for 100ms
}
}
\ No newline at end of file