Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
gcarmonar
Date:
Fri May 09 15:36:11 2014 +0000
Commit message:

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 54430c87a6e3 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Fri May 09 15:36:11 2014 +0000
@@ -0,0 +1,37 @@
+#include "mbed.h"
+ 
+Ticker toggle_led2;
+Ticker toggle_led3;
+DigitalOut led1(LED1);
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+ 
+void t_led2();
+void t_led3();
+
+ 
+int main() {
+    led2 = 1;
+    toggle_led2.attach(&t_led2, 1.0); // the address of the function to be attached and the interval (2 seconds)
+    toggle_led3.attach(&t_led3, 0.4);
+    
+    while(1) {
+        led1 = !led1;
+        wait(0.2);
+    }
+}
+
+void t_led2(){
+    led2 = !led2;
+}
+
+void t_led3(){
+    led3 = !led3;
+}
+
+
+
+
+
+
+
diff -r 000000000000 -r 54430c87a6e3 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Fri May 09 15:36:11 2014 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/8e73be2a2ac1
\ No newline at end of file