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.
Revision 1:d382876242bc, committed 2018-11-16
- Comitter:
- giggiux
- Date:
- Fri Nov 16 14:48:03 2018 +0000
- Parent:
- 0:d9ec23dd131e
- Commit message:
- assignment
Changed in this revision
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/main.cpp Thu Nov 08 12:18:12 2018 +0000
+++ b/main.cpp Fri Nov 16 14:48:03 2018 +0000
@@ -3,15 +3,23 @@
Ticker toggle_led_ticker;
DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+
+volatile uint8_t counter = 0;
void toggle_led() {
- led1 = !led1;
+ led1 = counter & 1;
+ led2 = counter & 2;
+ led3 = counter & 4;
}
int main() {
// Init the ticker with the address of the function (toggle_led) to be attached and the interval (100 ms)
toggle_led_ticker.attach(&toggle_led, 0.1);
while (true) {
+ counter += 1;
+ wait(1);
// Do other things...
}
}
\ No newline at end of file