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

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
mbed_Cookbook_SE
Date:
Wed Jan 20 14:50:40 2016 +0000
Commit message:
??

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 5509f1cc0703 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Wed Jan 20 14:50:40 2016 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+Serial pc(USBTX,USBRX); //追加
+
+int main() {
+    while(1) {
+        myled = 1;
+        pc.printf( "LED ON \r\n" ); // 追加:「LED ON」を表示する
+        wait(0.2);
+        myled = 0;
+        pc.printf( "LED OFF \r\n" ); // 追加:「LED OFF」を表示する
+        wait(0.2);
+    }
+}
diff -r 000000000000 -r 5509f1cc0703 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Jan 20 14:50:40 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/6f327212ef96
\ No newline at end of file