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

blinkencat3: rotate colours clockwise

parent 86bd556d
No related branches found
No related tags found
No related merge requests found
...@@ -115,8 +115,8 @@ void Blinkencat::check_battery(void) ...@@ -115,8 +115,8 @@ void Blinkencat::check_battery(void)
ADCSRA |= _BV(ADIF); ADCSRA |= _BV(ADIF);
//kout << "VCC is " << vcc << endl; //kout << "VCC is " << vcc << endl;
// 3 V under load ~~ 3.5 V idle // 3.1 V under load ~~ 3.5 V idle
if (vcc < 3000) { if (vcc < 3100) {
for (uint8_t i = 0; i < 5; i++) { for (uint8_t i = 0; i < 5; i++) {
for (uint8_t i = 0; i < NUM_PIXELS; i++) { for (uint8_t i = 0; i < NUM_PIXELS; i++) {
np.setPixelColor(i, np.Color(0, 0, 0)); np.setPixelColor(i, np.Color(0, 0, 0));
...@@ -170,7 +170,7 @@ void Blinkencat::loop(void) ...@@ -170,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, 255, 127))); np.setPixelColor((NUM_PIXELS-1) - 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();
...@@ -195,7 +195,7 @@ void Blinkencat::loop(void) ...@@ -195,7 +195,7 @@ void Blinkencat::loop(void)
case BRIGHTRGBWHEEL_SLOW: case BRIGHTRGBWHEEL_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((NUM_PIXELS-1) - i, np.gamma32(np.ColorHSV(hsv * 10)));
} }
rgbwheel_offset = (rgbwheel_offset + 10) % 6553; rgbwheel_offset = (rgbwheel_offset + 10) % 6553;
np.show(); np.show();
......
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