mbed1 - amalcharek

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

Led_Lcd.cpp

Committer:
amalcharek
Date:
2020-05-18
Revision:
1:534fe393f96f
Parent:
0:b6ccdd6b093a

File content as of revision 1:534fe393f96f:

#include "Led_Lcd.h"

#include "LCD_DISCO_F429ZI.h"
LCD_DISCO_F429ZI lcd;

LedLcd::LedLcd(unsigned char x){
    lcd.Clear(LCD_COLOR_BLACK);
    LEDXPOS = x*80;
    
}    

void LedLcd::On(unsigned char ucLedIndex){
    
    lcd.SetTextColor(LCD_COLOR_BLUE);
    lcd.FillRect(LEDXPOS, 0, 80, 320);
    
    lcd.SetTextColor(LCD_COLOR_YELLOW);
    lcd.FillRect(LEDXPOS, ucLedIndex*80, 79, 79);
    
    
    BSP_LCD_SetFont(&Font24);
    unsigned char ucButtonNumber[1];
    for(ucLedIndex = 0; ucLedIndex < 4; ucLedIndex++){
        lcd.SetBackColor(LCD_COLOR_RED);
        lcd.SetTextColor(LCD_COLOR_WHITE);
        sprintf((char*)ucButtonNumber, "%d", ucLedIndex);
        lcd.DisplayStringAt(LEDXPOS, ucLedIndex*80, (uint8_t *) ucButtonNumber, LEFT_MODE);
        lcd.SetTextColor(LCD_COLOR_GREEN);
        lcd.DrawRect(LEDXPOS, ucLedIndex*80, 79, 79);
    }
        

    
}