Kamil Maruta / Mbed 2 deprecated zad_2d_2

Dependencies:   BSP_DISCO_F429ZI LCD_DISCO_F429ZI TS_DISCO_F429ZI mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Lcd_Lcd.cpp Source File

Lcd_Lcd.cpp

00001 #include "LCD_DISCO_F429ZI.h"
00002 #include "Led_Lcd.h"
00003  
00004 LCD_DISCO_F429ZI lcd;
00005  
00006 LedLcd::LedLcd(unsigned char SetColumn)
00007 {   
00008     lcd.Clear(LCD_COLOR_BLACK);
00009     BSP_LCD_SetFont(&Font24);
00010     ucColChosen = SetColumn;
00011 }   
00012  
00013 void LedLcd::On(unsigned char ucLedIndex)
00014 {
00015     unsigned char ucLoopCounter = 0;
00016     for (ucLoopCounter = 0 ; ucLoopCounter <= 2 ; ucLoopCounter ++) {
00017         
00018         lcd.SetTextColor(LCD_COLOR_GREEN);
00019         lcd.DrawRect(80*ucLoopCounter,80* ucColChosen,80,80);
00020         if (ucLoopCounter == ucLedIndex)
00021             lcd.SetTextColor(LCD_COLOR_YELLOW);    
00022         else 
00023             lcd.SetTextColor(LCD_COLOR_BLUE); 
00024         lcd.FillRect(1 + 80*ucLoopCounter,1 + 80 * ucColChosen,78,78);
00025         lcd.SetBackColor(LCD_COLOR_RED);
00026         lcd.SetTextColor(LCD_COLOR_WHITE);
00027         lcd.DisplayChar(80*ucLoopCounter,80 * ucColChosen , 48 + ucLoopCounter );    
00028     }
00029 }   
00030