Aa
Dependents: EMBEED_III_zad_4 mbed3 mbed_3 MBED3_zad4
Diff: LED/Led.cpp
- Revision:
- 1:036ba0fc54a5
diff -r dc55a068bc1a -r 036ba0fc54a5 LED/Led.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/LED/Led.cpp Sat Jun 13 13:28:57 2020 +0000 @@ -0,0 +1,30 @@ +#include "Led.h" + +extern LCD_DISCO_F429ZI lcd; + +Led::Led(unsigned char ucColumn, unsigned char ucRow) +{ + this->ucColumn = ucColumn; + this->ucRow = ucRow; +} +void Led::Redraw(uint32_t Color) +{ + char cLedNumber[2] = {'0' + ucRow}; + char *pLedNumber = cLedNumber; + lcd.SetTextColor(Color); + lcd.FillRect(80*ucColumn+1, 80*ucRow+1, 78, 78); + lcd.SetTextColor(LCD_COLOR_GREEN); + lcd.DrawRect(80*ucColumn, 80*ucRow, 80, 80); + lcd.SetTextColor(LCD_COLOR_WHITE); + lcd.DisplayStringAt(80*ucColumn+1, 80*ucRow, (uint8_t *)pLedNumber, LEFT_MODE); +} + +void Led::On() +{ + Redraw(LCD_COLOR_YELLOW); +} + +void Led::Off() +{ + Redraw(LCD_COLOR_BLUE); +} \ No newline at end of file