2b
Fork of TS_DISCO_F429ZI by
Diff: Led_Lcd.cpp
- Revision:
- 1:ad1c1b95640c
diff -r 4f8b6df8e235 -r ad1c1b95640c Led_Lcd.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Led_Lcd.cpp Fri May 05 19:33:30 2017 +0000 @@ -0,0 +1,34 @@ +#include "mbed.h" +#include "LCD_DISCO_F429ZI.h" +#include "Led_Lcd.h" + +//LCD_DISCO_F429ZI lcd; +LedLcd::LedLcd(void){ + + 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,1+80*i,79,79); + LedLcd::SetTextColor(LCD_COLOR_GREEN); + LedLcd::FillRect(1,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, 0+i*80, (uint8_t *)&text, LEFT_MODE); + } + LedLcd::SetBackColor(LCD_COLOR_BLACK); +} + +