Finalna wersja programu 2d_2 z pierwszej części zestawu mbed
Dependencies: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
Led_Lcd.cpp
- Committer:
- azmuth_sd
- Date:
- 2020-05-12
- Revision:
- 1:29d67154ca51
- Parent:
- 0:15cfee7b5bad
File content as of revision 1:29d67154ca51:
#include "Led_Lcd.h" LedLcd::LedLcd(unsigned char ucColumn) { ucXLed = ucColumn * 80; lcd.Clear(LCD_COLOR_BLACK); lcd.SetBackColor(LCD_COLOR_RED); lcd.SetFont(&Font24); } void LedLcd::On(unsigned char ucCtr) { const char* btnText[] = {"0", "1", "2", "3"}; for(uint8_t i = 0; i < 4; i++) { lcd.SetTextColor(LCD_COLOR_GREEN); lcd.DrawRect(ucXLed, i*80, 80, 80); if( ucCtr == i ) { lcd.SetTextColor(LCD_COLOR_YELLOW); } else { lcd.SetTextColor(LCD_COLOR_BLUE); } lcd.FillRect(ucXLed+1, (80*i)+1 , 78, 78); lcd.SetTextColor(LCD_COLOR_WHITE); lcd.DisplayStringAt(ucXLed, i*80, (uint8_t *) btnText[i], LEFT_MODE); } }