AGH UST mbed part 3

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

KeyboardLed.cpp

Committer:
matis755
Date:
2020-06-16
Revision:
4:459a0389bb9f
Parent:
2:db40a2b0b177

File content as of revision 4:459a0389bb9f:

#include "KeyboardLed.h"

KeyboardLed::KeyboardLed(unsigned char _ucColumn) {
    pKeyboard = new Keyboard(_ucColumn);
    pLed = new Ledboard(_ucColumn);
};

enum KeyboardState KeyboardLed::eRead(void) {
    enum KeyboardState eButton = pKeyboard -> eRead();
    switch(eButton) {
        case BUTTON_0:
            pLed -> On(0);
            break;
        case BUTTON_1:
            pLed -> On(1);
            break;
        case BUTTON_2:
            pLed -> On(2);
            break;
        case BUTTON_3:
            pLed -> On(3);
            break;
        default :
            pLed -> Off();
            break;
    }  
    return eButton;
}