Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: MBED1zadD2 mbed BSP_DISCO_F429ZI
Led_Lcd.cpp
00001 #include "Led_Lcd.h" 00002 #define MAX_DISPLAY_NUMBER 3 00003 00004 LedLcd::LedLcd(unsigned char ucColumn){ 00005 LCD_Display.Clear(LCD_COLOR_BLACK); 00006 LCD_Display.SetBackColor(LCD_COLOR_RED); 00007 LCD_Display.SetFont(&Font24); 00008 uiColumnNumber=ucColumn; 00009 00010 On(4); 00011 } 00012 00013 void LedLcd::DrawKey(unsigned char ucKeyNumber){ 00014 LCD_Display.SetTextColor(LCD_COLOR_GREEN); 00015 LCD_Display.DrawRect((80*uiColumnNumber) ,ucKeyNumber*80,80,80); 00016 LCD_Display.SetTextColor(uiColor[ucKeyNumber]); 00017 LCD_Display.FillRect(1+80*uiColumnNumber , 1+ucKeyNumber*80, 79, 79); 00018 00019 LCD_Display.SetTextColor(LCD_COLOR_RED); 00020 LCD_Display.FillRect(80*uiColumnNumber, ucKeyNumber*80, 20, 25); 00021 LCD_Display.SetTextColor(LCD_COLOR_WHITE); 00022 char cDisplay[MAX_DISPLAY_NUMBER]; 00023 sprintf(cDisplay, "%d", ucKeyNumber); 00024 LCD_Display.DisplayStringAt(2+80*uiColumnNumber, 2+ucKeyNumber*80,(uint8_t *) cDisplay, LEFT_MODE); 00025 } 00026 00027 00028 void LedLcd::On(unsigned char ucKeyNumber){ 00029 uint8_t CurrentKey; 00030 for(CurrentKey=0; CurrentKey<NUMBER_OF_KEYS; CurrentKey++){ 00031 if(CurrentKey==ucKeyNumber){ 00032 uiColor[CurrentKey]=LCD_COLOR_GREEN; 00033 } 00034 else{ 00035 uiColor[CurrentKey]=LCD_COLOR_BLUE; 00036 } 00037 DrawKey(CurrentKey); 00038 } 00039 } 00040
Generated on Fri Jul 15 2022 15:56:12 by
1.7.2