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 mbed-os-example-mbed5-blinky by
Revision 17:f1532314d1a9, committed 2016-11-16
- Comitter:
- Pieter56
- Date:
- Wed Nov 16 20:02:33 2016 +0000
- Parent:
- 16:71f51c703eee
- Child:
- 18:d15cf1cad4c9
- Commit message:
- Added 2 led's alternatively blinking (red and green)
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Fri Oct 28 13:15:03 2016 +0100
+++ b/main.cpp Wed Nov 16 20:02:33 2016 +0000
@@ -1,13 +1,15 @@
#include "mbed.h"
-DigitalOut led1(LED1);
+DigitalOut led1(LED1, 0);
+DigitalOut led2(LED2, 1);
// main() runs in its own thread in the OS
// (note the calls to Thread::wait below for delays)
int main() {
while (true) {
+ Thread::wait(1000);
led1 = !led1;
- Thread::wait(500);
+ led2 = !led2;
}
}
