Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

Files at this revision

API Documentation at this revision

Comitter:
shinoku99
Date:
Mon May 18 12:27:21 2020 +0000
Parent:
2:74b337ef3533
Commit message:
2d_2 Tomasz Balon

Changed in this revision

Led_Lcd.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 74b337ef3533 -r 1809f618b474 Led_Lcd.cpp
--- a/Led_Lcd.cpp	Mon May 18 11:00:33 2020 +0000
+++ b/Led_Lcd.cpp	Mon May 18 12:27:21 2020 +0000
@@ -15,17 +15,14 @@
     MyLcd.SetTextColor(LCD_COLOR_YELLOW);
     MyLcd.FillRect(ucLedPosition, ucLedIndex*80, 80, 80);
     
-    MyLcd.SetTextColor(LCD_COLOR_GREEN);
-    for(int a=0; a<4; a++){
-        MyLcd.DrawRect(ucLedPosition, a*80, 80, 80);
+    MyLcd.SetFont(&Font24);
+    MyLcd.SetBackColor(LCD_COLOR_RED);
+    unsigned char ucButtonNumber[1];
+    for(ucLedIndex=0; ucLedIndex<4; ucLedIndex++){
+        MyLcd.SetTextColor(LCD_COLOR_WHITE);
+        sprintf((char *)ucButtonNumber, "%d", ucLedIndex);
+        MyLcd.DisplayStringAt(ucLedPosition, ucLedIndex*80, (uint8_t *) ucButtonNumber, LEFT_MODE);
+        MyLcd.SetTextColor(LCD_COLOR_GREEN);
+        MyLcd.DrawRect(ucLedPosition, ucLedIndex*80, 80, 80);
     }
-
-    MyLcd.SetFont(&Font24);
-
-    MyLcd.SetBackColor(LCD_COLOR_RED);
-    MyLcd.SetTextColor(LCD_COLOR_WHITE);
-    MyLcd.DisplayStringAt(ucLedPosition, 0, (uint8_t *)"0", LEFT_MODE);
-    MyLcd.DisplayStringAt(ucLedPosition, 80, (uint8_t *)"1", LEFT_MODE);
-    MyLcd.DisplayStringAt(ucLedPosition, 160, (uint8_t *)"2", LEFT_MODE);
-    MyLcd.DisplayStringAt(ucLedPosition, 240, (uint8_t *)"3", LEFT_MODE);
 }