Leidy Catalina Rodríguez Laverde / Mbed 2 deprecated Lcd_Teclado

Dependencies:   TextLCD mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "TextLCD.h"
00003 BusOut salida(D8,D9,D10,D11);
00004 BusIn entrada(D12,D13,D14,D15);
00005 int filas [5]={0,1,2,4,8};
00006 char tecla [6][6];
00007 int lectura;
00008 Serial pc(USBTX,USBRX);
00009 TextLCD Ale(D2,D3,D4,D5,D6,D7);
00010 int main() 
00011 {     
00012     tecla [1][1]='1';tecla [1][2]='2';tecla [1][3]='3';tecla [1][4]='A'; //MATRIZ
00013     tecla [2][1]='4';tecla [2][2]='5';tecla [2][3]='6';tecla [2][4]='B';
00014     tecla [3][1]='7';tecla [3][2]='8';tecla [3][3]='8';tecla [3][4]='C';
00015     tecla [4][1]='*';tecla [4][2]='0';tecla [4][3]='#';tecla [4][4]='D';
00016      
00017     while(1) 
00018     {
00019           for(int o=1;o<5;o++)
00020           {
00021               salida=filas[o];
00022               lectura=entrada.read();
00023               if (lectura==4){lectura=3;}if (lectura==8){lectura=4;}
00024               if (lectura!=0)
00025               {
00026                   Ale.printf("YA SIRVO Y DOY: %c\n\r",tecla[o][lectura]);
00027                           wait(0.2);}
00028               }
00029         }
00030         
00031     }
00032