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 digitalInPolling_sample by
Revision 3:2a7570e265fd, committed 2018-02-02
- Comitter:
- Bossman
- Date:
- Fri Feb 02 11:37:18 2018 +0000
- Parent:
- 2:cd1fe8c29793
- Commit message:
- Version 1
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Tue Jan 16 18:02:44 2018 +0000
+++ b/main.cpp Fri Feb 02 11:37:18 2018 +0000
@@ -49,15 +49,31 @@
/* ---- Main function (default thread) ----
Note that if this thread completes, nothing else works
*/
-int main() {
+int main()
+{
led = 1 ; // Initially off
pollT.start(callback(polling));
-
- while(true) {
+ int i=1;
+ while(true)
+ {
if (pressEvent) {
pressEvent = 0 ; // clear the event variable
+ if (i==6){
+ i=1;
+ }
+ while(1){
+
led = !led ;
- }
+ Thread::wait(i*200);
+ if (pressEvent){
+ i++;
+ break;
+ }
+
+
+ }
+}
+
Thread::wait(100) ;
}
}
\ No newline at end of file
