LED_LCD
Led_Lcd.cpp@1:75fda8f7834c, 2020-05-08 (annotated)
- Committer:
- krzysiek99
- Date:
- Fri May 08 19:03:38 2020 +0000
- Revision:
- 1:75fda8f7834c
a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
krzysiek99 | 1:75fda8f7834c | 1 | #include "Led_Lcd.h" |
krzysiek99 | 1:75fda8f7834c | 2 | |
krzysiek99 | 1:75fda8f7834c | 3 | LedLcd::LedLcd(unsigned char ucMode) |
krzysiek99 | 1:75fda8f7834c | 4 | { |
krzysiek99 | 1:75fda8f7834c | 5 | lcd.Clear(LCD_COLOR_BLACK); |
krzysiek99 | 1:75fda8f7834c | 6 | lcd.SetFont(&Font24); |
krzysiek99 | 1:75fda8f7834c | 7 | ucButtonsColumn = 80*ucMode; |
krzysiek99 | 1:75fda8f7834c | 8 | } |
krzysiek99 | 1:75fda8f7834c | 9 | |
krzysiek99 | 1:75fda8f7834c | 10 | void LedLcd::On(unsigned char ucLedNumber) |
krzysiek99 | 1:75fda8f7834c | 11 | { |
krzysiek99 | 1:75fda8f7834c | 12 | for(unsigned char ucCounter = 0; ucCounter < 4; ucCounter++) |
krzysiek99 | 1:75fda8f7834c | 13 | { |
krzysiek99 | 1:75fda8f7834c | 14 | lcd.SetTextColor(LCD_COLOR_GREEN); |
krzysiek99 | 1:75fda8f7834c | 15 | lcd.DrawRect(ucButtonsColumn, 80*ucCounter, 80, 80); |
krzysiek99 | 1:75fda8f7834c | 16 | if(ucLedNumber == ucCounter) |
krzysiek99 | 1:75fda8f7834c | 17 | lcd.SetTextColor(LCD_COLOR_YELLOW); |
krzysiek99 | 1:75fda8f7834c | 18 | else |
krzysiek99 | 1:75fda8f7834c | 19 | lcd.SetTextColor(LCD_COLOR_BLUE); |
krzysiek99 | 1:75fda8f7834c | 20 | |
krzysiek99 | 1:75fda8f7834c | 21 | lcd.FillRect(ucButtonsColumn+1, 80*ucCounter+1, 78, 78); |
krzysiek99 | 1:75fda8f7834c | 22 | } |
krzysiek99 | 1:75fda8f7834c | 23 | lcd.SetTextColor(LCD_COLOR_WHITE); |
krzysiek99 | 1:75fda8f7834c | 24 | lcd.SetBackColor(LCD_COLOR_RED); |
krzysiek99 | 1:75fda8f7834c | 25 | lcd.DisplayStringAt(ucButtonsColumn+1, LINE(0), (uint8_t *)"1", LEFT_MODE); |
krzysiek99 | 1:75fda8f7834c | 26 | lcd.DisplayStringAt(ucButtonsColumn+1, LINE(3.35), (uint8_t *)"2", LEFT_MODE); |
krzysiek99 | 1:75fda8f7834c | 27 | lcd.DisplayStringAt(ucButtonsColumn+1, LINE(6.7), (uint8_t *)"3", LEFT_MODE); |
krzysiek99 | 1:75fda8f7834c | 28 | lcd.DisplayStringAt(ucButtonsColumn+1, LINE(10), (uint8_t *)"4", LEFT_MODE); |
krzysiek99 | 1:75fda8f7834c | 29 | } |