ticker test

Dependencies:   mbed

Fork of ticker_test by sho hashimoto

Files at this revision

API Documentation at this revision

Comitter:
shokai
Date:
Sat Apr 24 14:04:37 2010 +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 e26c1a395072 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Apr 24 14:04:37 2010 +0000
@@ -0,0 +1,42 @@
+#include "mbed.h"
+#include <string>
+using namespace std;
+
+Serial pc(USBTX, USBRX);
+
+DigitalOut led1(LED1); // blink
+DigitalOut led2(LED2);
+DigitalOut led3(LED3);
+DigitalOut led4(LED4);
+
+Ticker t1, t2, t3, t4;
+
+void blink1(){
+    pc.printf("blink1_start\n");
+    led1 = !led1;
+    /*
+    wait(10);
+    pc.printf("blink1_end\n");
+    /**/
+}
+
+void blink2(){
+    led2 = !led2;
+}
+
+void blink3(){
+    led3 = !led3;
+}
+
+void blink4(){
+    led4 = !led4;
+}
+
+int main(void){
+    t1.attach(&blink1, 1.0);
+    t2.attach(&blink2, 2.0);
+    t3.attach(&blink3, 3.0);
+    t4.attach(&blink4, 0.6);
+    while(1){
+    }
+}
diff -r 000000000000 -r e26c1a395072 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Apr 24 14:04:37 2010 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/49a220cc26e0