test2
main.cpp@2:6b3d962ff593, 2015-04-15 (annotated)
- Committer:
- takt
- Date:
- Wed Apr 15 23:33:35 2015 +0000
- Revision:
- 2:6b3d962ff593
- Parent:
- 1:74279cff173c
add test.cpp
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
takt | 0:68493d5f15b1 | 1 | #include "mbed.h" |
takt | 0:68493d5f15b1 | 2 | #include "BufferedSerial.h" |
takt | 0:68493d5f15b1 | 3 | |
takt | 0:68493d5f15b1 | 4 | static unsigned int s_rx_in = 0; |
takt | 0:68493d5f15b1 | 5 | |
takt | 0:68493d5f15b1 | 6 | BufferedSerial pc(SERIAL_TX, SERIAL_RX); |
takt | 0:68493d5f15b1 | 7 | |
takt | 0:68493d5f15b1 | 8 | DigitalOut myled(LED1); |
takt | 0:68493d5f15b1 | 9 | |
takt | 0:68493d5f15b1 | 10 | int main() { |
takt | 0:68493d5f15b1 | 11 | while(1) { |
takt | 1:74279cff173c | 12 | // test |
takt | 0:68493d5f15b1 | 13 | myled = 1; // LED is ON |
takt | 0:68493d5f15b1 | 14 | wait(0.2); // 200 ms |
takt | 0:68493d5f15b1 | 15 | myled = 0; // LED is OFF |
takt | 0:68493d5f15b1 | 16 | wait(1.0); // 1 sec |
takt | 0:68493d5f15b1 | 17 | } |
takt | 0:68493d5f15b1 | 18 | } |