Hi. I’m a complete novice and I’m trying to start a project. For some reason google just isn’t my friend. I did find the perfect thing on YouTube and the guy sent me the code. But all I get is error messages galore.
Ok. So this is what I’m trying to do.
All I want is a rotating, trailing neopixel ring in blue using a nano. I’m finding it impossible to find anything. This picture is perfect but I’d settle for a single trail.
The "trick" to doing a pattern like that is to write a function that shifts your neoPixel values by one. Adafruit, who makes those rings supplies code to read the color values of any pixel. AND write color values to any pixel.
So you end up with two parts.
Draw the initial pattern on your ring one pixel at a time. You only need to do this once.
in loop()... This happens over and over forever.
shift your patten by one pixel.
wait a bit
And that's it.
Copying code off the internet typically will just confuse the living SH%& out of you and make you sound like a snowflake. This is a pattern seen about 100 times a day.
Hint on the shift function..
lets say we start at 0, because these things do.
copy the last pixel somewhere to save it.
copy pixel 0 to pixel 1
copy pixel 1 to pixel 2
... on and on..
copy second to last pixel to last pixel
copy the saved pixel to pixel 0
Jesusones:
I’ve managed to do that. It’s the fading trail I can’t work out.
Just apply different brightness when you copy over the colour. That is subtract a constant value from the RGB value or divide the RGB value you get by two each time.