Karla Garcia
/
ejercicio3_p6
.
Diff: main.cpp
- Revision:
- 0:749d5b4ae650
diff -r 000000000000 -r 749d5b4ae650 main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Jun 01 23:53:32 2020 +0000 @@ -0,0 +1,23 @@ +#include "mbed.h" +#include "C12832.h" + +C12832 lcd(SPI_MOSI, SPI_SCK, SPI_MISO, p8, p11); + +AnalogIn Ain(p15); +float ADCdata, voltaje; + +int main () { + while (1) { + ADCdata= Ain.read_u16(); + lcd.locate(0,3); + lcd.printf("R: %f", ADCdata); + voltaje= (ADCdata*5/1024); + + + lcd.locate(0,16); + lcd.printf("V: %f", voltaje); + printf("V: %f", ADCdata); + wait(0.5); + + } + } \ No newline at end of file