keypad corretto controllare il debounce

Dependencies:   TextLCD keypad mbed

main.cpp

Committer:
fdalforno
Date:
2018-05-13
Revision:
0:70e08bdedcba

File content as of revision 0:70e08bdedcba:

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



TextLCD lcd(D2,D3,D4,D5,D6,D7); 

Keypad telepad(PA_0 , PA_1 , PA_4 , PB_0,PA_13 , PA_14 , PC_2 , PC_3 );


int main() {
    lcd.locate(0,0);
    lcd.printf("KeyBoard: ");
    char key;
    while(1){
        lcd.locate(0,1);
        key = telepad.getKey(); 
        if(key != KEY_RELEASED){
            lcd.printf( "%c" , key);
            wait(0.6);
        }else{
            lcd.printf( "%c" , ' ');
        }
    }
}