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: LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI
Led_Lcd.cpp
00001 #include "Led_Lcd.h" 00002 00003 #define LENGTH_SIDE_SQUARE 80 00004 00005 DigitalOut myled(LED1); 00006 00007 LedLcd::LedLcd(unsigned char ucColumnNr){ 00008 lcd.Clear(LCD_COLOR_BLACK); 00009 lcd.SetFont(&Font24); 00010 square_x_pos = ucColumnNr * LENGTH_SIDE_SQUARE; 00011 } 00012 00013 void LedLcd::On(unsigned char uLedLcdNumber){ 00014 char cText[2] = {'0'}; 00015 char *pText = cText; 00016 00017 for(unsigned char ucSquareCounter = 0; ucSquareCounter <= 3; ucSquareCounter++){ 00018 *pText += 1; 00019 lcd.SetTextColor(LCD_COLOR_GREEN); 00020 lcd.DrawRect(square_x_pos, ucSquareCounter * LENGTH_SIDE_SQUARE, LENGTH_SIDE_SQUARE, LENGTH_SIDE_SQUARE); 00021 if(ucSquareCounter == uLedLcdNumber){ 00022 lcd.SetTextColor(LCD_COLOR_GREEN); 00023 } 00024 else{ 00025 lcd.SetTextColor(LCD_COLOR_BLUE); 00026 } 00027 lcd.FillRect(square_x_pos + 1, ucSquareCounter * LENGTH_SIDE_SQUARE + 1, LENGTH_SIDE_SQUARE - 2, LENGTH_SIDE_SQUARE - 2); 00028 lcd.SetBackColor(LCD_COLOR_RED); 00029 lcd.SetTextColor(LCD_COLOR_WHITE); 00030 lcd.DisplayStringAt(square_x_pos, ucSquareCounter * LENGTH_SIDE_SQUARE, (uint8_t *)pText, LEFT_MODE); 00031 } 00032 }
Generated on Sun Jul 24 2022 01:31:24 by
1.7.2