Conversor ADC to RS232

Dependencies:   mbed

Revision:
0:a942d6b61747
Child:
1:8d0067d6d183
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Sep 16 13:34:51 2019 +0000
@@ -0,0 +1,18 @@
+#include "mbed.h"
+
+float temperatura, valor_adc;
+AnalogIn   lm35  (A0); 
+Serial rs232(USBTX, USBRX); //enable serial port which links to USB
+ 
+int main() {
+    rs232.baud(9600);
+    while(1){
+        valor_adc = lm35;
+        temperatura= (valor_adc*3300/10);
+        rs232.printf("1.2f \n\r",temperatura);
+        wait(0.2);
+
+    }
+}
+
+