I took the basic Demo Reel sketch and changed it to use an 8 way rotary switch. I only have 2 wires in place right now so it only changes between 2 different patterns for now. It changes fine, no problems there, but I’m getting this weird twinkling effect and I don’t know why. I tried putting in an EVERY_N_MILLISECONDS(60) in the loop to slow down how often its reading the pins and drawing the pattern but all that did was slow down the twinkling. Any ideas why this is happening? Find the sketch here: https://pastebin.com/F51raM62
In your video I totally thought you were running rainbow with glitter, haha, but that’s not even in your patterns list. Hmmm, what if you comment out the print statements, or put them in an EVERY_N so they only run every second or two?
What controller are you using? Are you sure the pins you’re using have the ability to do INPUT_PULLUP?
@Yves_BAZIN how do you do that? I’m still not sure how to use an ESP32 with FastLED because of the different forks and me not being able to find the right docs.
Thought the same thing as @marmil , it looks just like the glitter effect. In my recent experience, I had to limit the brightness as I was pulling too much current from my power supply. How are you powering everything?
Right now I’m using an Adafruit circuit playground as my test platform. It will be running off a Teensy 3.2 in the final product. I’ll try modifying the code later as suggested and let you know how it goes.
Just peeked at your code now. I see brightness was set at 50, which isn’t that high. I would experiment with very low brightness, say 10, and see if anything changes. If you have more than 1 power source then make sure the grounds are connected between them all.
Ok the LEDS are being powered thru the Circuit Playground. Originally the rotary switch ground was to one pad on the CP while the LED was connected to a different ground on the CP. Put them on the same ground, no effect.
Took out the serial.,print completely. No effect.
Increased brightness to 100, decreased brightness to 10. No effect.
Attached a new strand of LEDs. No effect.
I’m only powering 30 LEDS thru the controller, I don’t think I need a level shifter. I’ve powered far more LEDS thru the controller with no problems.
WOOT! I figured out my problem! I had to put a BREAK command in my loop. Because it was going through the entire loop and changing the pattern when it shouldn’t.
for(uint8_t pin = 0; pin < pinCount; pin++) //Point to the Pin
{
myPointer = &ButtonPins[pin];
if (*myPointer == 0)
{
gPatternspin;
break;
}
}