Mbed cz.1 cwiczenie ostatnie (2d2)

Dependencies:   LCD_DISCO_F429ZI mbed TS_DISCO_F429ZI BSP_DISCO_F429ZI

Revision:
0:036c13c6cbb6
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Led_Lcd.cpp	Mon May 18 05:54:39 2020 +0000
@@ -0,0 +1,34 @@
+#include "Led_Lcd.h"
+
+LedLcd::LedLcd(unsigned char ucColumnIndex){
+    
+    ucLedPos = ucColumnIndex*80;
+    lcd.Clear(LCD_COLOR_BLACK);
+    BSP_LCD_SetFont(&Font24);    
+    lcd.SetBackColor(LCD_COLOR_RED);
+    //lcd.SetTextColor(LCD_COLOR_GREEN);
+    
+    //for(unsigned char ucRectNumber = 0; ucRectNumber < 4; ucRectNumber++){
+      //  lcd.DrawRect(ucLedPos, ucRectNumber*80, 80, 80);
+    //}
+}
+
+void LedLcd::On(unsigned char ucLedIndex){
+    
+    unsigned char ucKeyNumber[2];
+    
+    for(unsigned char ucKeyCounter = 0; ucKeyCounter < 4; ucKeyCounter++){
+        if(ucLedIndex == ucKeyCounter){
+            lcd.SetTextColor(LCD_COLOR_YELLOW);    
+        }
+        else{
+            lcd.SetTextColor(LCD_COLOR_BLUE);
+        }
+        lcd.FillRect(ucLedPos+1, ucKeyCounter*80 + 1, 79, 79);
+        lcd.SetTextColor(LCD_COLOR_WHITE);
+        sprintf((char*)ucKeyNumber, "%d", ucKeyCounter);
+        lcd.DisplayStringAt(ucLedPos, ucKeyCounter*80, (uint8_t *) &ucKeyNumber, LEFT_MODE);
+        lcd.SetTextColor(LCD_COLOR_GREEN);
+        lcd.DrawRect(ucLedPos, ucKeyCounter*80, 80, 80);
+    }
+}  
\ No newline at end of file