スイッチを押すと2秒間モーターが回るプログラムです。

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
kohacraft
Date:
Mon Dec 28 03:42:55 2015 +0000
Commit message:
ver1.0;

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 ea8160d85d16 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Dec 28 03:42:55 2015 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+
+DigitalOut myled(LED1);
+DigitalIn sw(dp28);
+
+int main() {
+    while(1) {
+        myled = 0;
+        if( sw == 1 )
+        {
+            myled = 1;
+            wait(2);
+            myled = 0;
+        }
+    }
+}
diff -r 000000000000 -r ea8160d85d16 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Dec 28 03:42:55 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4336505e4b1c
\ No newline at end of file