Initial version.

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

Committer:
bridzysta
Date:
Mon May 25 12:36:53 2020 +0000
Revision:
1:6a6bc6bc51b0
Parent:
0:00760a80f72b
New version

Who changed what in which revision?

UserRevisionLine numberNew contents of line
bridzysta 0:00760a80f72b 1 #include "Led_Lcd.h"
bridzysta 1:6a6bc6bc51b0 2 #include <stdio.h>
bridzysta 0:00760a80f72b 3
bridzysta 0:00760a80f72b 4 LCD_DISCO_F429ZI lcd;
bridzysta 0:00760a80f72b 5
bridzysta 0:00760a80f72b 6 LedLcd::LedLcd(unsigned char ucColumnXPosition)
bridzysta 0:00760a80f72b 7 {
bridzysta 0:00760a80f72b 8 ucColumnXIndex = (ucColumnXPosition * 80);
bridzysta 0:00760a80f72b 9 lcd.Clear(LCD_COLOR_BLACK);
bridzysta 1:6a6bc6bc51b0 10 lcd.SetFont(&Font24);
bridzysta 0:00760a80f72b 11 }
bridzysta 0:00760a80f72b 12
bridzysta 0:00760a80f72b 13 void LedLcd::On(unsigned char ucButtonLight)
bridzysta 0:00760a80f72b 14 {
bridzysta 0:00760a80f72b 15 uint16_t Ypos = 0;
bridzysta 1:6a6bc6bc51b0 16 char text[2];
bridzysta 1:6a6bc6bc51b0 17 lcd.SetBackColor(LCD_COLOR_RED);
bridzysta 0:00760a80f72b 18 for(unsigned char ucButtonNumber = 0; ucButtonNumber < 4; ucButtonNumber++){
bridzysta 0:00760a80f72b 19 lcd.SetTextColor(LCD_COLOR_GREEN);
bridzysta 1:6a6bc6bc51b0 20 lcd.DrawRect(ucColumnXIndex, 0+Ypos, 80, 80);
bridzysta 1:6a6bc6bc51b0 21 if(ucButtonNumber == ucButtonLight){
bridzysta 1:6a6bc6bc51b0 22 lcd.SetTextColor(LCD_COLOR_GREEN);
bridzysta 1:6a6bc6bc51b0 23 }
bridzysta 1:6a6bc6bc51b0 24 else{
bridzysta 1:6a6bc6bc51b0 25 lcd.SetTextColor(LCD_COLOR_BLUE);
bridzysta 1:6a6bc6bc51b0 26 }
bridzysta 1:6a6bc6bc51b0 27 lcd.FillRect(ucColumnXIndex+1, 1+Ypos, 79, 79);
bridzysta 1:6a6bc6bc51b0 28 lcd.SetTextColor(LCD_COLOR_WHITE);
bridzysta 1:6a6bc6bc51b0 29 sprintf(text, "%d", ucButtonNumber);
bridzysta 1:6a6bc6bc51b0 30 lcd.DisplayStringAt(ucColumnXIndex, 1+Ypos, (uint8_t *)&text, LEFT_MODE);
bridzysta 1:6a6bc6bc51b0 31 Ypos = Ypos + 80;
bridzysta 0:00760a80f72b 32 }
bridzysta 0:00760a80f72b 33 }