Gustavo Ramirez / Mbed 2 deprecated lecturaAnalogaYPC

Dependencies:   TextLCD mbed

Fork of lecturaAnaloga by Gustavo Ramirez

Files at this revision

API Documentation at this revision

Comitter:
tony63
Date:
Mon Sep 28 23:58:26 2015 +0000
Parent:
2:7d8925e51f85
Commit message:
revision con comunicacion serie entrando y saliendo en analogo

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/main.cpp	Mon Sep 28 22:26:22 2015 +0000
+++ b/main.cpp	Mon Sep 28 23:58:26 2015 +0000
@@ -7,15 +7,21 @@
 Serial pc(USBTX,USBRX); //puertos del PC
 AnalogIn Vin(PTC2);
 TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5); // rs, e, d4-d7
+int SalidaAnaloga;
+AnalogOut u(PTE30);
+float c;
+
 
 int main( ){
+    while(1){
+    pc.scanf("%f", &c);
+    lcd.locate(0,0);
+    lcd.printf("Volt(%f)", Vin.read());
+    lcd.locate(0,1);
+    lcd.printf("Vout(%f)",c);
+    pc.printf("%f\n",Vin.read());
+    u.write(c);
     
-    lcd.cls();
-    wait(0.1);
-    while(1){
-    lcd.cls();
-    lcd.printf("Volt(%f)", Vin.read());
-    pc.printf("%f\n", Vin.read()); 
     wait(0.1);
 }
 }
\ No newline at end of file