Delong Qi
/
LinkNode_Time_and_Serial
LinkNode_Time_and_Serial
Fork of mbed_blinky by
Revision 11:7e847d3aa735, committed 2016-04-13
- Comitter:
- helloqi
- Date:
- Wed Apr 13 12:24:43 2016 +0000
- Parent:
- 10:3e42ca878d11
- Commit message:
- LinkNode_Time_and_Serial
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 3e42ca878d11 -r 7e847d3aa735 main.cpp --- a/main.cpp Sun Jan 17 03:25:27 2016 +0000 +++ b/main.cpp Wed Apr 13 12:24:43 2016 +0000 @@ -1,12 +1,20 @@ -#include "mbed.h" +#include<mbed.h> -DigitalOut myled(LED1); +Serial pc(P0_23,P0_25); +DigitalOut led(P0_20); +Timer timer; + -int main() { - while(1) { - myled = 1; - wait(0.2); - myled = 0; - wait(0.2); - } +void callback(void) +{ + led = ~led; + printf("hello everyone!\r\n"); } + +int main() +{ + Ticker ticker; + ticker.attach(callback,1); + while(1); +} +