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.
Dependencies: mbed
Diff: main.cpp
- Revision:
- 1:dcd96a8ef857
- Parent:
- 0:5014bf742e9b
- Child:
- 2:8b678520a9fb
--- a/main.cpp Thu Feb 14 14:30:22 2013 +0000
+++ b/main.cpp Fri Sep 30 20:43:53 2022 +0000
@@ -3,18 +3,30 @@
Ticker flipper;
DigitalOut led1(LED1);
DigitalOut led2(LED2);
-
-void flip() {
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+void flip2() {
led2 = !led2;
}
+void flip1() {
+ led1 = !led1;
+}
+void flip3() {
+ led3 = !led3;
+}
+void flip4() {
+ led4 = !led4;
+}
int main() {
led2 = 1;
- flipper.attach(&flip, 2.0); // the address of the function to be attached (flip) and the interval (2 seconds)
-
+ flipper.attach(&flip2, 2 ); // the address of the function to be attached (flip) and the interval (2 seconds)
+ flipper.attach(&flip1, 1);
+ flipper.attach(&flip3, 4);
+ flipper.attach(&flip4, 8);
// spin in a main loop. flipper will interrupt it to call flip
while(1) {
- led1 = !led1;
- wait(0.2);
- }
+ led1 = !led1;
+ }
}
\ No newline at end of file