Page 68 - Proyecto integrador final - Génesis Orozco Chauca
P. 68

DISEÑO




































                     CÓDIGO:                                    void loop() {

                     #include <Keypad.h>                        //Verifica si alguna tecla fue
                     const byte filas = 4;                      presionada
                     const byte columnas = 4;
                     byte pinesFilas[] =                        char tecla =
                     {11,10,9,8};                               teclado1.getKey();
                     byte pinesColumnas[] =
                     {7,6,5,4};                                 //Monitor Serial
                     char teclas[4][4] =
                     {{'1','2','3','A'},
                     {'4','5','6','B'},                         if (tecla)
                     {'7','8','9','C'},                         {if (tecla=='1')
                     {'*','0','#','D'}};                        {digitalWrite (2, HIGH);}
                     Keypad teclado1 = Keypad(                  if (tecla=='A')
                     makeKeymap(teclas),                        {digitalWrite (2, LOW);
                     pinesFilas, pinesColumnas,                 }if (tecla=='4')
                     filas, columnas);                          {
                     void setup()                               digitalWrite (3, HIGH);
                     { Serial.begin(9600);                      }
                     Serial.println("Teclado 4x4
                     con Biblioteca Keypad");
                     Serial.println();
                     pinMode(2,OUTPUT);
                     pinMode(3,OUTPUT);
                     pinMode(12,OUTPUT);                   68
                     pinMode(13,OUTPUT);
                     }
   63   64   65   66   67   68   69   70   71   72   73