Arkadiusz Pępkowski / Mbed 2 deprecated z2_2

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers main.cpp Source File

main.cpp

00001 #include "mbed.h"
00002 #include "KeyboardTsLcd.h"
00003 
00004 int main(){
00005 
00006     KeyboardTsLcd Keyboard(0);
00007     KeyboardTsLcd LedLcd(2);
00008     
00009     while(1){
00010         Keyboard.eRead();
00011         wait(0.1);
00012         switch(Keyboard.pKeyboard -> eRead()){
00013             case BUTTON_0:
00014                 LedLcd.pLed -> On(BUTTON_3);
00015             break;
00016             case BUTTON_1:
00017                 LedLcd.pLed -> On(BUTTON_2);
00018             break;
00019             case BUTTON_2:
00020                 LedLcd.pLed -> On(BUTTON_1);
00021             break;
00022             case BUTTON_3:
00023                 LedLcd.pLed -> On(BUTTON_0);
00024             break;
00025             default:
00026                 LedLcd.pLed -> On(NO_BUTTON_PRESSED);
00027             break;
00028         }
00029         wait(0.1);
00030     }
00031 }