Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of lecturaAnaloga by
Diff: main.cpp
- Revision:
- 2:7d8925e51f85
- Parent:
- 1:d4b9822b8df4
- Child:
- 3:19594b07824c
--- a/main.cpp Thu Oct 03 21:55:19 2013 +0000
+++ b/main.cpp Mon Sep 28 22:26:22 2015 +0000
@@ -1,18 +1,21 @@
// ejemplo lectura analoga
// EJEMPLO CON UN LCD PARA EL MODULO FRDM-KL25Z PARA LECTURA ANALOGA
+//y enviar al pc por puerto serial
#include "mbed.h"
#include "TextLCD.h"
+Serial pc(USBTX,USBRX); //puertos del PC
AnalogIn Vin(PTC2);
TextLCD lcd(PTB10, PTB11, PTE2, PTE3, PTE4, PTE5); // rs, e, d4-d7
int main( ){
lcd.cls();
- wait(0.5);
+ wait(0.1);
while(1){
lcd.cls();
- lcd.printf("V(%f)", Vin.read());
- wait(0.5);
+ lcd.printf("Volt(%f)", Vin.read());
+ pc.printf("%f\n", Vin.read());
+ wait(0.1);
}
}
\ No newline at end of file
