Programa Teclao y LCD
Dependencies: Keypad TextLCD mbed
Diff: main.cpp
- Revision:
- 0:52ff9a225855
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Thu Apr 27 05:47:14 2017 +0000 @@ -0,0 +1,28 @@ +#include "mbed.h" +#include "TextLCD.h" +#include "Keypad.h" + +TextLCD lcd(PTE20,PTE21,PTE22,PTE23,PTE29,PTE30, TextLCD::LCD16x2); // Rs, E, d4, d5, d6, d7, RW=GND +Keypad keypad(PTC4,PTC3,PTC0,PTC7,PTC11,PTC10,PTC6,PTC5); // c1, c2, c3, c4, f1, f2, f3, f4 + +char key; +int released=1; + +int main() +{ + lcd.printf("Teclado y LCD"); + wait(1); + lcd.cls(); + + while (1) { + key=keypad.ReadKey(); + if(key=='\0') released=1; + if((key!='\0') && (released==1)) { + lcd.locate(0,0); + lcd.printf("Tecla Pulsada: %c",key); + released=0; + } + + wait(.1); + } +} \ No newline at end of file