summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Baumann <derflob@derflob.de>2015-02-22 17:41:02 +0100
committerFlorian Baumann <derflob@derflob.de>2015-02-22 17:41:02 +0100
commiteaabcd02d2bc4c92bc3653c0aa8501db29a3ad33 (patch)
tree5425b3c934630e217b72e102002e5d4012c22f98
parent5dc0629212c179e368d1437a3cb05c7be798a493 (diff)
downloadStripClock-blue_min.tar.gz
StripClock-blue_min.tar.bz2
show only every 5th minblue_min
-rw-r--r--StripClock.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/StripClock.c b/StripClock.c
index 34502e1..4e2b811 100644
--- a/StripClock.c
+++ b/StripClock.c
@@ -244,8 +244,8 @@ uint8_t updateStrip(void)
for (uint8_t i = 0; i < LEDS; i++) {
int16_t r, g, b = 0;
- const int16_t cur_min_r = 5 + brightness;
- const int16_t cur_min_g = 16 + brightness;
+ const int16_t cur_min_r = 2 + brightness;
+ const int16_t cur_min_g = 8 + brightness;
const int16_t cur_min_b = 1 + brightness;
const int16_t past_min_r = 2 + brightness;
const int16_t past_min_g = 2 + brightness;
@@ -275,24 +275,32 @@ uint8_t updateStrip(void)
r = g = b = 0;
}
- if (r > 255) r = 0;
- if (g > 255) g = 0;
- if (b > 255) b = 0;
+ if (r > 255 || r < 0) r = 0;
+ if (g > 255 || g < 0) g = 0;
+ if (b > 255 || b < 0) b = 0;
if (i % 15 == 14) {
r *= 0;
g *= 6;
- b *= 12;
+ b *= 10;
+ r = 2;
+ g = 2;
+ b = 1;
} else if (i % 5 == 4) {
r *= 0;
g *= 2;
b *= 4;
+ r = 2;
+ g = 2;
+ b = 1;
+ } else if (!(i == dt.minute || i == dt.minute - 1)) {
+ r = g = b = 0;
}
if (i == hour_led) {
r = 1 + brightness * 2;
- g = 1 + brightness * 2;
- b = 60 + brightness * 2;
+ g = 5 + brightness * 2;
+ b = 16 + brightness * 2;
}
leds[i].r = r;