mbed電子工作レシピ リスト2.3のプログラム

Dependencies:   mbed

Committer:
mbed_Cookbook_SE
Date:
Wed Jan 20 14:50:40 2016 +0000
Revision:
0:5509f1cc0703
??

Who changed what in which revision?

UserRevisionLine numberNew 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 }