mbed1 - amalcharek

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

Files at this revision

API Documentation at this revision

Comitter:
amalcharek
Date:
Mon May 18 14:01:25 2020 +0000
Parent:
0:b6ccdd6b093a
Commit message:
mbed1 - amalcharek;

Changed in this revision

Led_Lcd.cpp Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/Led_Lcd.cpp	Sat May 16 11:23:08 2020 +0000
+++ b/Led_Lcd.cpp	Mon May 18 14:01:25 2020 +0000
@@ -17,19 +17,17 @@
     lcd.SetTextColor(LCD_COLOR_YELLOW);
     lcd.FillRect(LEDXPOS, ucLedIndex*80, 79, 79);
     
-        lcd.SetTextColor(LCD_COLOR_GREEN);
-        lcd.DrawRect(LEDXPOS, 0, 79, 79);
-        lcd.DrawRect(LEDXPOS, 80, 79, 79);
-        lcd.DrawRect(LEDXPOS, 160, 79, 79);
-        lcd.DrawRect(LEDXPOS, 240, 79, 79);
     
-        BSP_LCD_SetFont(&Font24);
+    BSP_LCD_SetFont(&Font24);
+    unsigned char ucButtonNumber[1];
+    for(ucLedIndex = 0; ucLedIndex < 4; ucLedIndex++){
         lcd.SetBackColor(LCD_COLOR_RED);
         lcd.SetTextColor(LCD_COLOR_WHITE);
-        lcd.DisplayStringAt(LEDXPOS + 1, 1, (uint8_t *)"1", LEFT_MODE);
-        lcd.DisplayStringAt(LEDXPOS + 1, 81, (uint8_t *)"2", LEFT_MODE);
-        lcd.DisplayStringAt(LEDXPOS + 1, 161, (uint8_t *)"3", LEFT_MODE);
-        lcd.DisplayStringAt(LEDXPOS + 1, 241, (uint8_t *)"4", LEFT_MODE);
+        sprintf((char*)ucButtonNumber, "%d", ucLedIndex);
+        lcd.DisplayStringAt(LEDXPOS, ucLedIndex*80, (uint8_t *) ucButtonNumber, LEFT_MODE);
+        lcd.SetTextColor(LCD_COLOR_GREEN);
+        lcd.DrawRect(LEDXPOS, ucLedIndex*80, 79, 79);
+    }
         
 
     
--- a/main.cpp	Sat May 16 11:23:08 2020 +0000
+++ b/main.cpp	Mon May 18 14:01:25 2020 +0000
@@ -1,15 +1,11 @@
 #include "mbed.h"
 #include "KeyboardTsLcd.h"
 #include "Led_Lcd.h"
-#include "Keyboard_Ts.h"
 
 int main()
 {
     KeyboardTsLcd Keyboard(0);
     LedLcd Led(2);
-    while(1){
-        Keyboard.eRead();
-        wait(0.1);
         
         while(1) {
         switch(Keyboard.eRead()) {
@@ -31,5 +27,5 @@
         }
         wait(0.1);
     }
-        }
+        
 }