electronics-lab / Mbed 2 deprecated Infra-RedSeonsor

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
ponpoko1939
Date:
Wed Apr 04 02:10:50 2018 +0000
Child:
1:9d0c57c475ce
Commit message:
comiiit;

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	Wed Apr 04 02:10:50 2018 +0000
@@ -0,0 +1,13 @@
+#include "mbed.h"
+
+Serial pc(USBTX,USBRX);
+AnalogIn ain(p20);
+double distance;
+
+int main() {
+    while(1){
+        distance = ain.read();
+        pc.printf("Distance:%f\n\r",distance);
+        wait(0.5);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Apr 04 02:10:50 2018 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/994bdf8177cb
\ No newline at end of file