Jaycar-Electronics / WiFi-Controlled-Strip-Lighting

Control some dazzling RGB effects with ESP8266 and Vue.js web app!
7 stars 0 forks source link

Made changes to the lightEffects.cpp #3

Closed wrexy1994 closed 4 years ago

wrexy1994 commented 4 years ago

I have changed the Solid/Alternate so the lights alternate between colorOne and ColorTwo. Changes are as follows: Added line at 14: int phase = 0; changes: case Alternate: for (int i = 0; i < n; i++) { if (i % 2 == phase) light.setPixelColor(i, colorOne); else light.setPixelColor(i, colorTwo); } phase = 1 - phase; break;

I think the Mix should be as follows: case Mix: for (int i = 0; i < n; i++) { light.setPixelColor(i, RED(colorOne) - redStep i, GREEN(colorOne) - greenStep i, BLUE(colorOne) - blueStep * i); } break; Makes the strip light change from colorOne to ColorTwo. Do you agree? Cheers

Jaycar-Electronics commented 4 years ago

ah, you mean to interlace it? ( let's say for R = colour1 red, and B = colour2 blue ):

RBRBRBRBRBRB - instead of the current: - RRRRRRRRRBBBBBBBBB

I suppose that makes much more sense; I was thinking half-n-half but having alternate per pixel is a better idea

Do you want to try to submit a "pull request" or should I just add the changes and add your username to a contribution list?

Jaycar-Electronics commented 4 years ago

this has been changed in 43e4996

Let me know if that fixes it! Thanks for bringing it to our attention.