Class to display Time in words on WS2812B-LED-Stripe. * Drive LEDs with PixelArray * with 11x10 LED-Matrix and 4 minute-LEDS * GERMAN LAYOUT !!!!!!
Details and usage see https://os.mbed.com/users/charly/code/WordClock/wiki/Homepage
Revision 1:dd9657c12de6, committed 2017-11-06
- Comitter:
- charly
- Date:
- Mon Nov 06 20:45:54 2017 +0000
- Parent:
- 0:0f571ea154f8
- Child:
- 2:284c13980da8
- Commit message:
- added sz() and wz() for display of DST-Info
Changed in this revision
| WordClock.cpp | Show annotated file Show diff for this revision Revisions of this file |
| WordClock.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/WordClock.cpp Sun Nov 05 20:30:51 2017 +0000
+++ b/WordClock.cpp Mon Nov 06 20:45:54 2017 +0000
@@ -295,6 +295,21 @@
ledstripe_[113] = hsvToRgb(hue_, saturation_, float(second)/60);
}
+void WordClock::sz()
+{
+ cls();
+ ledstripe_[4] = hsvToRgb(hue_, saturation_, value_);
+ ledstripe_[17] = hsvToRgb(hue_, saturation_, value_);
+ array_.update(ledstripe_,NUMLEDS);
+}
+
+void WordClock::wz()
+{
+ cls();
+ ledstripe_[16] = hsvToRgb(hue_, saturation_, value_);
+ ledstripe_[13] = hsvToRgb(hue_, saturation_, value_);
+ array_.update(ledstripe_,NUMLEDS);
+}
void WordClock::test_display(int option, int index)
{
@@ -310,7 +325,7 @@
break;
}
case 2 : {
- //display one LED in WHite, full brightness
+ //display one LED in White, full brightness
ledstripe_[index] = hsvToRgb(1.0, 0.0, 1.0);//white
array_.update(ledstripe_,NUMLEDS);
break;
--- a/WordClock.h Sun Nov 05 20:30:51 2017 +0000
+++ b/WordClock.h Mon Nov 06 20:45:54 2017 +0000
@@ -31,7 +31,7 @@
//Number of different words
#define NUMWORDS 28
-/* Class: WorldClock
+/** Class: WorldClock
* A class to show time in words with LED-Stripe
*/
class WordClock {
@@ -54,6 +54,9 @@
/** test_display(int option)
*
* @param option option for test
+* 1 color gradient from red to red through hsv colors.
+* 2 display one LED in White, full brightness.
+* 3 display a word.
* @param index index for test. Which LED/word to set. 0..NUMLEDS, 0..NUMWORDS
*
*/
@@ -100,6 +103,15 @@
void m2(int second = 59);
void m3(int second = 59);
void m4(int second = 59);
+
+public:
+/** display SZ for Sommerzeit
+*/
+ void sz(); //Sommerzeit
+/** display WZ for Winterzeit
+*/
+ void wz(); //Winterzeit
+private:
//Digitalin for Pulldown
DigitalIn di_pin_;