Skip to content
Snippets Groups Projects
Commit eb75130b authored by Birte Kristina Friesel's avatar Birte Kristina Friesel
Browse files

blinkencat3: decrease default brightness

parent ae87fe14
No related branches found
No related tags found
No related merge requests found
...@@ -21,8 +21,11 @@ class Blinkencat { ...@@ -21,8 +21,11 @@ class Blinkencat {
RGBWHEEL_SLOW, RGBWHEEL_SLOW,
RGBFADE_FAST, RGBFADE_FAST,
RGBFADE_SLOW, RGBFADE_SLOW,
BRIGHTRGBWHEEL_FAST,
BRIGHTRGBWHEEL_SLOW,
BRIGHTRGBFADE_FAST,
BRIGHTRGBFADE_SLOW,
COLD_WHITE, COLD_WHITE,
BEEDOO,
STROBE, STROBE,
COLOR_STROBE, COLOR_STROBE,
MODE_ENUM_MAX MODE_ENUM_MAX
...@@ -139,7 +142,6 @@ void Blinkencat::loop(void) ...@@ -139,7 +142,6 @@ void Blinkencat::loop(void)
{ {
static uint16_t rgbwheel_offset = 0; static uint16_t rgbwheel_offset = 0;
static uint16_t rgbfade_hsv = 0; static uint16_t rgbfade_hsv = 0;
static uint8_t beedoo_pos = 0;
static uint8_t strobe_on = 0; static uint8_t strobe_on = 0;
/* /*
...@@ -168,7 +170,7 @@ void Blinkencat::loop(void) ...@@ -168,7 +170,7 @@ void Blinkencat::loop(void)
case RGBWHEEL_SLOW: case RGBWHEEL_SLOW:
for (uint16_t i = 0; i < NUM_PIXELS; i++) { for (uint16_t i = 0; i < NUM_PIXELS; i++) {
uint16_t hsv = (i * 252 + rgbwheel_offset) % 6553; uint16_t hsv = (i * 252 + rgbwheel_offset) % 6553;
np.setPixelColor(i, np.gamma32(np.ColorHSV(hsv * 10))); np.setPixelColor(i, np.gamma32(np.ColorHSV(hsv * 10, 255, 127)));
} }
rgbwheel_offset = (rgbwheel_offset + 10) % 6553; rgbwheel_offset = (rgbwheel_offset + 10) % 6553;
np.show(); np.show();
...@@ -180,7 +182,7 @@ void Blinkencat::loop(void) ...@@ -180,7 +182,7 @@ void Blinkencat::loop(void)
case RGBFADE_FAST: case RGBFADE_FAST:
case RGBFADE_SLOW: case RGBFADE_SLOW:
for (uint16_t i = 0; i < NUM_PIXELS; i++) { for (uint16_t i = 0; i < NUM_PIXELS; i++) {
np.setPixelColor(i, np.ColorHSV(rgbfade_hsv * 10)); np.setPixelColor(i, np.ColorHSV(rgbfade_hsv * 10, 255, 63));
} }
rgbfade_hsv = (rgbfade_hsv + 10) % 6553; rgbfade_hsv = (rgbfade_hsv + 10) % 6553;
np.show(); np.show();
...@@ -189,20 +191,37 @@ void Blinkencat::loop(void) ...@@ -189,20 +191,37 @@ void Blinkencat::loop(void)
_delay_ms(99); _delay_ms(99);
} }
break; break;
case COLD_WHITE: case BRIGHTRGBWHEEL_FAST:
case BRIGHTRGBWHEEL_SLOW:
for (uint16_t i = 0; i < NUM_PIXELS; i++) { for (uint16_t i = 0; i < NUM_PIXELS; i++) {
np.setPixelColor(i, np.Color(127, 127, 127)); uint16_t hsv = (i * 252 + rgbwheel_offset) % 6553;
np.setPixelColor(i, np.gamma32(np.ColorHSV(hsv * 10)));
} }
rgbwheel_offset = (rgbwheel_offset + 10) % 6553;
np.show(); np.show();
sleep(); _delay_ms(1);
if (mode == BRIGHTRGBWHEEL_SLOW) {
_delay_ms(9);
}
break; break;
case BEEDOO: case BRIGHTRGBFADE_FAST:
case BRIGHTRGBFADE_SLOW:
for (uint16_t i = 0; i < NUM_PIXELS; i++) { for (uint16_t i = 0; i < NUM_PIXELS; i++) {
np.setPixelColor(i, np.Color(0, 0, (i+2 - beedoo_pos <= 2) * 255)); np.setPixelColor(i, np.ColorHSV(rgbfade_hsv * 10));
} }
rgbfade_hsv = (rgbfade_hsv + 10) % 6553;
np.show(); np.show();
beedoo_pos = (beedoo_pos + 1) % NUM_PIXELS; _delay_ms(1);
_delay_ms(20); if (mode == BRIGHTRGBFADE_SLOW) {
_delay_ms(99);
}
break;
case COLD_WHITE:
for (uint16_t i = 0; i < NUM_PIXELS; i++) {
np.setPixelColor(i, np.Color(127, 127, 127));
}
np.show();
sleep();
break; break;
case STROBE: case STROBE:
for (uint16_t i = 0; i < NUM_PIXELS; i++) { for (uint16_t i = 0; i < NUM_PIXELS; i++) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment