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.
Diff: Led.cpp
- Revision:
- 1:9835e5b1371a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/Led.cpp Sat May 23 20:23:28 2020 +0000
@@ -0,0 +1,37 @@
+#include "Led.h"
+
+#define COLOR_LIT LCD_COLOR_GREEN
+#define COLOR_DARK LCD_COLOR_BLUE
+
+extern LCD_DISCO_F429ZI lcd;
+
+Led::Led(unsigned char ucColumnNumber, unsigned char ucRowNumber)
+{
+ ucColumn = ucColumnNumber;
+ ucRow = ucRowNumber;
+
+ Redraw(COLOR_DARK);
+}
+
+void Led::On()
+{
+ Redraw(COLOR_LIT);
+}
+
+void Led::Off()
+{
+ Redraw(COLOR_DARK);
+}
+
+void Led::Redraw(uint32_t Color)
+{
+ char cBuffor[3];
+ lcd.SetTextColor(LCD_COLOR_GREEN);
+ lcd.DrawRect(80*ucColumn,80*ucRow,80,80);
+ lcd.SetTextColor(Color);
+ lcd.FillRect(2+80*ucColumn,2+80*ucRow,77,77);
+
+ sprintf(cBuffor, "%d", ucRow);
+ lcd.SetTextColor(LCD_COLOR_WHITE);
+ lcd.DisplayStringAt(1+80*ucColumn,1+80*ucRow,(uint8_t *)&cBuffor, LEFT_MODE);
+}
\ No newline at end of file