Clavier 16 touches et afficheur LCD

Dependencies:   mbed KeypadLib TextLCD

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "keypad.h"
00003 #include "TextLCD.h"
00004  
00005 int main() {
00006 DigitalOut led(PC_13);
00007              //  C1   C2   C3   C4   L1   L2   L3   L4    
00008  Keypad clavier( PA_3,PA_2,PA_1,PA_0,PA_7,PA_6,PA_5,PA_4 );
00009 
00010          //  RS     E      D4    D5    D6     D7
00011  TextLCD lcd(PA_9, PA_8, PB_15, PB_14, PB_13, PB_12,TextLCD::LCD16x2);
00012       
00013     clavier.enablePullUp();
00014     char key;
00015     lcd.cls();
00016     lcd.printf("TP2 2GII ENETCOM");
00017     while (1)  {
00018          key = clavier.getKey();    
00019          if(key != 0)  {
00020             lcd.cls();
00021             lcd.printf("%c",key);
00022             led = !led;
00023             wait(0.2);
00024          }
00025     }
00026 }
00027