
LinkNode_Time_and_Serial
Fork of mbed_blinky by
main.cpp@11:7e847d3aa735, 2016-04-13 (annotated)
- Committer:
- helloqi
- Date:
- Wed Apr 13 12:24:43 2016 +0000
- Revision:
- 11:7e847d3aa735
- Parent:
- 4:81cea7a352b0
LinkNode_Time_and_Serial
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
helloqi | 11:7e847d3aa735 | 1 | #include<mbed.h> |
dan | 0:7dec7e9ac085 | 2 | |
helloqi | 11:7e847d3aa735 | 3 | Serial pc(P0_23,P0_25); |
helloqi | 11:7e847d3aa735 | 4 | DigitalOut led(P0_20); |
helloqi | 11:7e847d3aa735 | 5 | Timer timer; |
helloqi | 11:7e847d3aa735 | 6 | |
dan | 0:7dec7e9ac085 | 7 | |
helloqi | 11:7e847d3aa735 | 8 | void callback(void) |
helloqi | 11:7e847d3aa735 | 9 | { |
helloqi | 11:7e847d3aa735 | 10 | led = ~led; |
helloqi | 11:7e847d3aa735 | 11 | printf("hello everyone!\r\n"); |
dan | 0:7dec7e9ac085 | 12 | } |
helloqi | 11:7e847d3aa735 | 13 | |
helloqi | 11:7e847d3aa735 | 14 | int main() |
helloqi | 11:7e847d3aa735 | 15 | { |
helloqi | 11:7e847d3aa735 | 16 | Ticker ticker; |
helloqi | 11:7e847d3aa735 | 17 | ticker.attach(callback,1); |
helloqi | 11:7e847d3aa735 | 18 | while(1); |
helloqi | 11:7e847d3aa735 | 19 | } |
helloqi | 11:7e847d3aa735 | 20 |