prueba teclado matricial 4x3

Dependencies:   TextLCD mbed

Fork of LCD_test_teclado by proyectotecnicas

main.cpp

Committer:
josedaparte
Date:
2015-12-01
Revision:
2:667119ffc7cc
Parent:
1:85232e54cfcf

File content as of revision 2:667119ffc7cc:

#include "mbed.h"
#include "TextLCD.h"


TextLCD lcd(PTD3, PTA12, PTA4, PTA5, PTC8, PTC9, TextLCD::LCD16x2);

DigitalIn key1(PTE31);
DigitalIn key2(PTE19);
DigitalIn key3(PTE18);
DigitalIn key4(PTE17);
InterruptIn Enable(PTA13);

int num, B1,B2,B3,B4;

void func()
{
    lcd.cls();
    lcd.printf(" %d ", num);
    wait(1);
    lcd.cls(); 
}
    
int main() {

    while(1)
    {    
    
    B1 = key1.read();
    B2 = key2.read();
    B3 = key3.read();
    B4 = key4.read();
    
    num = 2*2*2*B1 + 2*2*B2 + 2*B3 + B4;
    
    Enable.rise(&func);
    }
}