2d1
Fork of TS_DISCO_F429ZI by
Led_Lcd.cpp@1:972c0d202476, 2017-05-05 (annotated)
- Committer:
- Robsonik16
- Date:
- Fri May 05 19:38:00 2017 +0000
- Revision:
- 1:972c0d202476
a
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Robsonik16 | 1:972c0d202476 | 1 | #include "mbed.h" |
Robsonik16 | 1:972c0d202476 | 2 | #include "LCD_DISCO_F429ZI.h" |
Robsonik16 | 1:972c0d202476 | 3 | #include "Led_Lcd.h" |
Robsonik16 | 1:972c0d202476 | 4 | |
Robsonik16 | 1:972c0d202476 | 5 | //LCD_DISCO_F429ZI lcd; |
Robsonik16 | 1:972c0d202476 | 6 | LedLcd::LedLcd(unsigned char _ucCol){ |
Robsonik16 | 1:972c0d202476 | 7 | ucCol=_ucCol; |
Robsonik16 | 1:972c0d202476 | 8 | |
Robsonik16 | 1:972c0d202476 | 9 | LedLcd::SetFont(&Font24); |
Robsonik16 | 1:972c0d202476 | 10 | } |
Robsonik16 | 1:972c0d202476 | 11 | |
Robsonik16 | 1:972c0d202476 | 12 | |
Robsonik16 | 1:972c0d202476 | 13 | |
Robsonik16 | 1:972c0d202476 | 14 | void LedLcd::On(unsigned char ucLedIndex){ |
Robsonik16 | 1:972c0d202476 | 15 | LedLcd::SetTextColor(LCD_COLOR_BLUE); |
Robsonik16 | 1:972c0d202476 | 16 | for(uint8_t i=0; i<4; i++) LedLcd::FillRect(1+80*ucCol,1+80*i,79,79); |
Robsonik16 | 1:972c0d202476 | 17 | LedLcd::SetTextColor(LCD_COLOR_GREEN); |
Robsonik16 | 1:972c0d202476 | 18 | LedLcd::FillRect(1+80*ucCol,1+80*ucLedIndex,79,79); |
Robsonik16 | 1:972c0d202476 | 19 | LedLcd::DrawNumber(); |
Robsonik16 | 1:972c0d202476 | 20 | } |
Robsonik16 | 1:972c0d202476 | 21 | |
Robsonik16 | 1:972c0d202476 | 22 | void LedLcd::DrawNumber() |
Robsonik16 | 1:972c0d202476 | 23 | { |
Robsonik16 | 1:972c0d202476 | 24 | uint8_t text[3]; |
Robsonik16 | 1:972c0d202476 | 25 | LedLcd::SetTextColor(LCD_COLOR_WHITE); |
Robsonik16 | 1:972c0d202476 | 26 | LedLcd::SetBackColor(LCD_COLOR_RED); |
Robsonik16 | 1:972c0d202476 | 27 | for(uint8_t i=0; i<4; i++) { |
Robsonik16 | 1:972c0d202476 | 28 | sprintf((char*)text, "%d", i); |
Robsonik16 | 1:972c0d202476 | 29 | LedLcd::DisplayStringAt(0+80*ucCol, 0+i*80, (uint8_t *)&text, LEFT_MODE); |
Robsonik16 | 1:972c0d202476 | 30 | } |
Robsonik16 | 1:972c0d202476 | 31 | LedLcd::SetBackColor(LCD_COLOR_BLACK); |
Robsonik16 | 1:972c0d202476 | 32 | } |
Robsonik16 | 1:972c0d202476 | 33 | |
Robsonik16 | 1:972c0d202476 | 34 |