情報物理II (2018) / Mbed 2 deprecated WSN-tani

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
tani_n
Date:
Wed Dec 05 02:09:47 2018 +0000
Commit message:
WSN-tani

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 Dec 05 02:09:47 2018 +0000
@@ -0,0 +1,22 @@
+#include "mbed.h"
+Serial xbe1(dp16, dp15);
+DigitalOut myled(LED1);
+Serial pc(USBTX, USBRX);
+AnalogIn analog_value(dp13);
+
+int main() {
+    float meas, temp;
+    
+    int count=0;
+    myled=0;
+    while(1){
+        meas=analog_value.read();
+        meas=meas*3300;
+        temp=0.1*meas-50;
+        
+        myled=0;
+        xbe1.printf("40D7B70A> %d: temp = %.1f C\r\n", count++, temp);
+        wait_ms(1000);
+        myled=1;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Wed Dec 05 02:09:47 2018 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/3a7713b1edbc
\ No newline at end of file