
Test BufferedSerial class
Dependencies: BufferedSerial mbed
main.cpp@0:0237e9476a18, 2014-09-06 (annotated)
- Committer:
- jurgis
- Date:
- Sat Sep 06 12:55:21 2014 +0000
- Revision:
- 0:0237e9476a18
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jurgis | 0:0237e9476a18 | 1 | #include "mbed.h" |
jurgis | 0:0237e9476a18 | 2 | #include "BufferedSerial.h" |
jurgis | 0:0237e9476a18 | 3 | |
jurgis | 0:0237e9476a18 | 4 | |
jurgis | 0:0237e9476a18 | 5 | DigitalOut myled(LED2); |
jurgis | 0:0237e9476a18 | 6 | BufferedSerial pc(USBTX, USBRX); |
jurgis | 0:0237e9476a18 | 7 | //Serial pc(USBTX, USBRX); |
jurgis | 0:0237e9476a18 | 8 | |
jurgis | 0:0237e9476a18 | 9 | |
jurgis | 0:0237e9476a18 | 10 | int main() |
jurgis | 0:0237e9476a18 | 11 | { |
jurgis | 0:0237e9476a18 | 12 | pc.baud(115200); |
jurgis | 0:0237e9476a18 | 13 | pc.printf("\r\n\r\nProgram started\r\n"); |
jurgis | 0:0237e9476a18 | 14 | |
jurgis | 0:0237e9476a18 | 15 | while(1) |
jurgis | 0:0237e9476a18 | 16 | { |
jurgis | 0:0237e9476a18 | 17 | pc.printf("OFF\r\n"); |
jurgis | 0:0237e9476a18 | 18 | myled = 1; |
jurgis | 0:0237e9476a18 | 19 | wait(1); |
jurgis | 0:0237e9476a18 | 20 | |
jurgis | 0:0237e9476a18 | 21 | pc.printf("ON\r\n"); |
jurgis | 0:0237e9476a18 | 22 | myled = 0; |
jurgis | 0:0237e9476a18 | 23 | wait(1); |
jurgis | 0:0237e9476a18 | 24 | } |
jurgis | 0:0237e9476a18 | 25 | } |