code review

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

Committer:
thepaueu
Date:
Thu May 14 18:45:14 2020 +0000
Revision:
0:db2c7dc10f89
Pawel Majtas cw 2d2

Who changed what in which revision?

UserRevisionLine numberNew contents of line
thepaueu 0:db2c7dc10f89 1 #include "LedLcd.h"
thepaueu 0:db2c7dc10f89 2
thepaueu 0:db2c7dc10f89 3
thepaueu 0:db2c7dc10f89 4
thepaueu 0:db2c7dc10f89 5
thepaueu 0:db2c7dc10f89 6 LedLcd::LedLcd(unsigned char ucStartCol){
thepaueu 0:db2c7dc10f89 7 lcd.Clear(LCD_COLOR_BLACK);
thepaueu 0:db2c7dc10f89 8 lcd.SetFont(&Font24);
thepaueu 0:db2c7dc10f89 9 ucColumn = ucStartCol;
thepaueu 0:db2c7dc10f89 10 }
thepaueu 0:db2c7dc10f89 11
thepaueu 0:db2c7dc10f89 12 void LedLcd::On( unsigned char ucPos){
thepaueu 0:db2c7dc10f89 13
thepaueu 0:db2c7dc10f89 14 uint8_t text[2];
thepaueu 0:db2c7dc10f89 15 unsigned char ucRect;
thepaueu 0:db2c7dc10f89 16
thepaueu 0:db2c7dc10f89 17 for (ucRect=0;ucRect<4;ucRect++){
thepaueu 0:db2c7dc10f89 18
thepaueu 0:db2c7dc10f89 19 lcd.SetTextColor(LCD_COLOR_GREEN);
thepaueu 0:db2c7dc10f89 20 lcd.DrawRect(ucColumn*80,ucRect*80,80,80);
thepaueu 0:db2c7dc10f89 21
thepaueu 0:db2c7dc10f89 22 if(ucPos==ucRect)
thepaueu 0:db2c7dc10f89 23 lcd.SetTextColor(LCD_COLOR_YELLOW);
thepaueu 0:db2c7dc10f89 24 else
thepaueu 0:db2c7dc10f89 25 lcd.SetTextColor(LCD_COLOR_BLUE);
thepaueu 0:db2c7dc10f89 26
thepaueu 0:db2c7dc10f89 27 lcd.FillRect(1 + ucColumn*80,ucRect*80+1,78,78);
thepaueu 0:db2c7dc10f89 28 lcd.SetBackColor(LCD_COLOR_RED);
thepaueu 0:db2c7dc10f89 29 lcd.SetTextColor(LCD_COLOR_WHITE);
thepaueu 0:db2c7dc10f89 30 sprintf((char*)text, "%d", ucRect);
thepaueu 0:db2c7dc10f89 31 lcd.DisplayStringAt(ucColumn*80, ucRect*80,(uint8_t *)&text,LEFT_MODE);
thepaueu 0:db2c7dc10f89 32
thepaueu 0:db2c7dc10f89 33 }
thepaueu 0:db2c7dc10f89 34 }