Teclado y LCD 2x16
Dependencies: TextLCD keypad mbed
Revision 1:faf520c1baac, committed 2017-04-24
- Comitter:
- franni
- Date:
- Mon Apr 24 23:07:57 2017 +0000
- Parent:
- 0:3a2f24d6afbd
- Child:
- 2:4df925890cca
- Commit message:
- Serial rs232
Changed in this revision
test1.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/test1.cpp Mon Apr 24 22:20:06 2017 +0000 +++ b/test1.cpp Mon Apr 24 23:07:57 2017 +0000 @@ -2,8 +2,11 @@ #include "TextLCD.h" #include "Keypad.h" -//Serial PC(USBTX, USBRX); - +Serial rs232(USBTX, USBRX); +AnalogIn Ain(PTB0); + +float ADCdata; + // Define your own keypad values char Keytable[] = { '1', '2', '3', 'A', // r0 '4', '5', '6', 'B', // r1 @@ -25,17 +28,24 @@ int main() { - lcd.printf("Mi primer tecladito...\r\n"); - wait(1); - lcd.cls(); - lcd.locate(0,0); + // r0 r1 r2 r3 c0 c1 c2 c3 Keypad keypad(PTC9, PTC8, PTA5, PTA4, PTA12, PTD4, PTA1, PTA2); keypad.attach(&cbAfterInput); keypad.start(); // energiza columnas c0-c3 del keypad + + rs232.printf("Temperatura ADC \n\r"); + lcd.printf("Temperatura ADC \r\n"); + wait(1); + lcd.cls(); + lcd.locate(0,0); while (1) { + //ADCdata=Ain; + //rs232.printf("%f \n\r",ADCdata); + rs232.printf(" %f ",Ain.read()*5); + wait(.1); __wfi(); if (Index > -1) { lcd.printf("Key:%c\r\n",Keytable[Index]);