In the following sketch: https://gist.github.com/chemdoc77/377b214d92c06ee4a8cc016bf7bb7b93 When I run only this function in the loop:

In the following sketch:

When I run only this function in the loop: cd77_police_lights_one_modified(4, 50, CRGB::White); (see line 38), it works as expected when running on a Nano, Wemos D1 Mini Pro and a Teensy 3.1 and a NeoPixel 24 pixel ring. Both the Wemos D1 Mini Pro and a Teensy 3.1 have level shifters. I am using the latest version of FastLED with an Arduino 1.8.5 IDE.

When I run only this function in the loop: cd77_police_lights_one_modified _2_dots (4, 50, CRGB::White); (see line 39), It works on the Teensy 3.1. It does not work on the Wemos D1 Mini Pro as it lights up briefly and goes dark. When I run it on the Nano, it hangs up, pauses for a while, moves a little and hangs up again. The same thing happens on the Nano when I run it with the color blue. However, it runs as expected on the Nano when I run it with the color red.

When running cd77_police_lights_one_modified(4, 50, CRGB::White), you have four white pixels equally spaced moving around the ring and for cd77_police_lights_one_modified _2_dots (4, 50, CRGB::White) you have four pairs of white pixels equally spaced moving around the ring.

I have no idea what is causing the problem on the Nano or the Wemos D1 Mini Pro since when I compile it with the Arduino 1.8.5 IDE, I have plenty of memory and RAM left over.

Any help in how to make the sketch running with only cd77_police_lights_one_modified _2_dots (4, 50, CRGB::White) in the loop (line 39 only) on a Nano would be greatly appreciated.

I’ve had a quick look on my phone.

In the second function when X=0 and z=0, y then equals 0. Then you write to led 0 and led -1.

Writing outside of the led array, or any array, will give unexpected results…

Can you show the changed sketch, my knowledge of this programming is not that great.

@Anx_Xna - This problem might be solved using the same technique used in the FastLED example, XYmatrix, and how it deals with out of bounds pixels. Due to my summer teaching schedule at two local colleges, I will not be able to work on this until this weekend.

@Jeremy_Spencer - Thank you for finding my problem in my code and letting me know about it.

Thank you for helping with such a busy work load I really appreciate it, this is no rush, just happy some one is helping.
I’m still trying to learn how the code works, like the +, =, x, and 0 what they do? Thanks again.

@Anx_Xna - You might want to read the Arduino tutorials from Adafruit at:

https://learn.adafruit.com/category/learn-arduino

Also, the Arduino reference webpage gives a lot of great information, too. It can be found at:

https://www.arduino.cc/reference/en/

Both helped me get started with the basics of Arduino programming.

@Anx_Xna - I have just modified the following sketch so that it will work with one or two pixels groups being on in a ring:

I tested it on an Arduino Nano with a 24 pixel NeoPixel ring and it works well. Using the out of bounds code from the FastLED XYMatrix example solved the problem with two pixels being on.

I am looking forward to seeing a video of your United Planets Cruiser C-57D from Forbidden Planet. Forbidden Planet is one of my all time favorite movies especially the monster from the ID and when it tried to go thru the force field fence.

You got it I’ll do it video to show all the work and I’ll make sure I give you credit for helping me

Changed Code to make 2 strips work, Now I need to make one of the strips fade and maybe a 3rd blink for Interior any Idea how I can do this?

I found a code from adafruit that might work if you can help me figure out how to add or change the police lights to 1 of the pins 3, 5, 7 that would be great also how to change the colors.
Thanks again!

I also found a video of exactly what I want to make happen.