スイッチを押すごとにLEDが点灯、消灯するプログラムです。

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
jksoft
Date:
Sat Aug 18 13:55:32 2012 +0000
Commit message:
Rev1

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sat Aug 18 13:55:32 2012 +0000
@@ -0,0 +1,15 @@
+#include "mbed.h"
+
+DigitalIn enable(p5);
+DigitalOut led(p6);
+
+int main()
+{
+    enable.mode(PullUp);
+    while(1) {
+        if(enable) {
+            led = !led;
+        }
+        wait(0.25);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sat Aug 18 13:55:32 2012 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/10b9abbe79a6
\ No newline at end of file