Rotating trailing neopixels

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.

I’d be very appreciative if anyone can help me.

But all I get is error messages galore.

So what you do is read the how to use this forum sticky post and using the instructions you read there post your code that gives you error.

Also post the errors in another code window and we will try and sort it out.

However we will tell you what is wrong, we do not usually correct it for you.

Normally a problem like this is because you have not installed the libraries the code is asking for.

code window??

code window??

Yes have you not read all of How to use this forum?

You click the </> icon on the top left hand corner of the reply box and paste your error messages or code between what pops up.

Can you post your youtube link ?

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

Now everyone is shifted over by one.

good luck!

-jim lee

I’ve managed to do that. It’s the fading trail I can’t work out.

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.

Hmm. I’ll give it a go. I’ll let you know how I get on.

it might help if you posted your code.

read how to use this forum, #7 to understand what a code tag i and how to use it.