ธรรมธวัช หอสุวรรณ
/
sharing_test
testing
main.cpp@0:c72ced9fc66a, 2017-08-08 (annotated)
- Committer:
- neonomia
- Date:
- Tue Aug 08 05:09:46 2017 +0000
- Revision:
- 0:c72ced9fc66a
test
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
neonomia | 0:c72ced9fc66a | 1 | #include "mbed.h" |
neonomia | 0:c72ced9fc66a | 2 | |
neonomia | 0:c72ced9fc66a | 3 | DigitalOut myled(LED1); |
neonomia | 0:c72ced9fc66a | 4 | Serial pc(USBTX, USBRX); // tx, rx |
neonomia | 0:c72ced9fc66a | 5 | |
neonomia | 0:c72ced9fc66a | 6 | |
neonomia | 0:c72ced9fc66a | 7 | int main() { |
neonomia | 0:c72ced9fc66a | 8 | pc.baud (115200); |
neonomia | 0:c72ced9fc66a | 9 | pc.printf("Hello User!\n"); |
neonomia | 0:c72ced9fc66a | 10 | while(1) { |
neonomia | 0:c72ced9fc66a | 11 | myled = 1; // LED is ON |
neonomia | 0:c72ced9fc66a | 12 | wait(0.05); // 200 ms |
neonomia | 0:c72ced9fc66a | 13 | myled = 0; // LED is OFF |
neonomia | 0:c72ced9fc66a | 14 | wait(0.05); // 1 sec |
neonomia | 0:c72ced9fc66a | 15 | } |
neonomia | 0:c72ced9fc66a | 16 | } |