Junichi Katsu
/
mbed_blinky_Sirial
mbed電子工作レシピ リスト2.3のプログラム
main.cpp@0:5509f1cc0703, 2016-01-20 (annotated)
- Committer:
- mbed_Cookbook_SE
- Date:
- Wed Jan 20 14:50:40 2016 +0000
- Revision:
- 0:5509f1cc0703
??
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
mbed_Cookbook_SE | 0:5509f1cc0703 | 1 | #include "mbed.h" |
mbed_Cookbook_SE | 0:5509f1cc0703 | 2 | |
mbed_Cookbook_SE | 0:5509f1cc0703 | 3 | DigitalOut myled(LED1); |
mbed_Cookbook_SE | 0:5509f1cc0703 | 4 | Serial pc(USBTX,USBRX); //追加 |
mbed_Cookbook_SE | 0:5509f1cc0703 | 5 | |
mbed_Cookbook_SE | 0:5509f1cc0703 | 6 | int main() { |
mbed_Cookbook_SE | 0:5509f1cc0703 | 7 | while(1) { |
mbed_Cookbook_SE | 0:5509f1cc0703 | 8 | myled = 1; |
mbed_Cookbook_SE | 0:5509f1cc0703 | 9 | pc.printf( "LED ON \r\n" ); // 追加:「LED ON」を表示する |
mbed_Cookbook_SE | 0:5509f1cc0703 | 10 | wait(0.2); |
mbed_Cookbook_SE | 0:5509f1cc0703 | 11 | myled = 0; |
mbed_Cookbook_SE | 0:5509f1cc0703 | 12 | pc.printf( "LED OFF \r\n" ); // 追加:「LED OFF」を表示する |
mbed_Cookbook_SE | 0:5509f1cc0703 | 13 | wait(0.2); |
mbed_Cookbook_SE | 0:5509f1cc0703 | 14 | } |
mbed_Cookbook_SE | 0:5509f1cc0703 | 15 | } |