TaChing Yu / Mbed 2 deprecated LM35

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
yu10078999
Date:
Sun Sep 04 07:42:25 2016 +0000
Commit message:
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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Sep 04 07:42:25 2016 +0000
@@ -0,0 +1,16 @@
+#include "mbed.h"
+
+AnalogIn lm35(A0);
+Serial pc(USBTX, USBRX);
+
+int main() {
+    float val,tempC,tempF;
+    while(1) 
+    {
+        val=lm35.read();
+        tempC=(val*2.8f*100);
+        tempF=(9.0f*tempC)/5.0f + 32.0f;
+        printf("%.2f\n%.2f\n",tempC,tempF);
+        wait(2);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Sep 04 07:42:25 2016 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/2241e3a39974
\ No newline at end of file