2c
Fork of TS_DISCO_F429ZI by
Led_Lcd.cpp
- Committer:
- Robsonik16
- Date:
- 2017-05-05
- Revision:
- 1:b346257d266d
File content as of revision 1:b346257d266d:
#include "mbed.h" #include "LCD_DISCO_F429ZI.h" #include "Led_Lcd.h" //LCD_DISCO_F429ZI lcd; LedLcd::LedLcd(unsigned char _ucCol){ ucCol=_ucCol; LedLcd::SetFont(&Font24); } void LedLcd::On(unsigned char ucLedIndex){ LedLcd::SetTextColor(LCD_COLOR_BLUE); for(uint8_t i=0; i<4; i++) LedLcd::FillRect(1+80*ucCol,1+80*i,79,79); LedLcd::SetTextColor(LCD_COLOR_GREEN); LedLcd::FillRect(1+80*ucCol,1+80*ucLedIndex,79,79); LedLcd::DrawNumber(); } void LedLcd::DrawNumber() { uint8_t text[3]; LedLcd::SetTextColor(LCD_COLOR_WHITE); LedLcd::SetBackColor(LCD_COLOR_RED); for(uint8_t i=0; i<4; i++) { sprintf((char*)text, "%d", i); LedLcd::DisplayStringAt(0+80*ucCol, 0+i*80, (uint8_t *)&text, LEFT_MODE); } LedLcd::SetBackColor(LCD_COLOR_BLACK); }