Asked — Edited
Resolved by RobertL184!
Has anyone used a NeoPixel Ring before. I can't figure out how to wire it or connect it to EZB. Here is a link to the NeoPixel Ring site it has a data sheet.
I have look at the I2C but not sure what address or how it is wired.
Upgrade to ARC Pro
Harnessing the power of ARC Pro, your robot can be more than just a simple automated machine.
i tryed the Code/script from Robert!
An i like it really much!
Everything works, but only the "Scanner"/"Knight rider" functions has some problems.
SendSerial( D18,9600,"S,255,0,0,20" )
If i change to some scripts and then back to the Scanner Script, often this Script not start, so the Neopixel Ring will be still black!
It might be ("C,0,0,0"), i cant remember off the top of my head.
i check your tipp with sending a "turn light off" command, but the same situation with the scanner fx. All other Commands like Wipe, Rainbow, Color, Fade works 100% perfekt without sending a "light off" command, only the Scanner Command not works everytime.
Now i sending this code:
and now its works like that:
one red pixel is turning on for one second and then tunring off. Thats it. I can repeat this 10 times, all time the same.
To correct this problem i must send some other commands like a "fade" or "wipe" and then again sending the "scanner" command and then he works.
If you don´t know, nevermind, all other commands works to 100%, i only wondering why only the scanner command no works. I think in the Arduino Code must be the mistake/error
Sorry for the question: So the best solution is , not to use the "scanner" fx or do you know a method or somebody what/who can fix the error?
The Scanner FX is a red dot/pixel what starts on the left site and turn to the right and back to the left and so on.
Image the "Knight Rider" Light but not as a stripe - now in a circle.
Sometime the red light starts and make the moving, but sometime the red light goes on for one second and then goes off and thats it.
Like i said. all other oves like the Wipe;Fade;Rainbow,Color works fine! Only the Scanner makes problems!
Try this, this will run indefinitely or until another command is sent,
If you want it run for a set period of time, Try this example, this will run for 60 seconds, then stop.
**Change the port to your setting**
I tried your code for multitasking with a neopixel ring and no matter what input I use (C, R, F or T....) the pixels stay dark! I know the HW setup and connections are all correct. Am I missing something or there is something missing from the code?
In order to successfully compile the code I added
right above the neoPatterns
to set overal brightness
And my final question is:
I have added a potentiometer to Arduino multi-tasking code part-3 which is working fine. The pot is for controlling the brightness, however I would like to learn how to remove serial input from your code and make it go through all the animations steps within the loop. I now I can use the strandtest to achieve my goal, but then due to delay() I have to wait for the entire loop to complete before seeing the new brightness setting (through potentiometer).
You can modify the update routine to read your potentiometer and modify the brightness at that point. It may not modify the brightness immediately but it should modify the within a reasonable amount of time.
Thank you for your quick reply. I'm sorry if I was not clear with question.
I have the pot working with the Adafruit multi-tasking part-3 and it's responsive.
I would like to get your code working for my project and the issue I am running into is that all LEDs are dark and I have combed through the code and I was not able to find the culprit.
BTW - I added my potentiometer code to your code and monitored it via serial UI and it's working.
I would like to know if there is anything missing from the code causing the ring to stay dark. If not, then I am doing something wrong.
The mulitasking code has a strand on pins 5,6, and 7
NeoPatterns Ring1(24, 5, NEO_GRB + NEO_KHZ800, &Ring1Complete);
NeoPatterns Ring2(16, 6, NEO_GRB + NEO_KHZ800, &Ring2Complete);
NeoPatterns Stick(16, 7, NEO_GRB + NEO_KHZ800, &StickComplete);
My code has the strand on pin 6
NeoPatterns Ring1(16, 6, NEO_GRB + NEO_KHZ800, &Ring1Complete);
So the first thing to check is that the NeoPattern Ring1 is being called with the correct pin number to match your wiring.
The second thing to note is that my code was hacked together to allow the EZ-B to control the neopixel strip. To get the arduino to light up the string you want to have the EZ-B send the arduino a command.
Like "F0,0,255,0,0,0,50,25,0" to have it do a fade.
The command for the EZ-B to do this is SendSerial(d0, 9600, "F0,0,255,0,0,0,50,25,0") assuming of course that the arduino is wired up to get serial data from the "d0" pin.
To try is you can use the serial monitor in the arduino IDE to send the serial string to the arduino.
If you don't want any serial control at all. The multitasking code should work for you.
I haven't tried the updated code with CochranRobotics EZ-B Plugin.
Modify the variables:
red1, green1, blue1, red2, blue2, green2, and t for the colors and delay time you want.
I haven't complied the code above so don't know as it will work without some debugging.
You didn't mention where you put the code to read you potentiometer and set the Brightness in the multitasking code, but you could most likely put it in the same place in my code. It is based on the multitasking code.
Remember setting the strand brightness reduces the number of colors available for the entire strand. The same effect can be had for most of the routines my simply changing the red1, green1, blue1, red2, blue2, green2 variable to smaller values. The exception to this is the rainbow routine which uses all of the colors. For that one routine the Brightness setting would work best.
Thank you for all your feedback and I will re-check the Arduino pin connection, but I am certain that is not the cause. When I change the
the ring lights up. Also, I put few println in the code for sanity check and I see the output is the SUI.
Below is the code I added to yours and Arduino multi-tasking part-3 for the potentiometer and I know it works with the latter. The ints are placed under the NeoPatterns line and the rest is placed within the loop. I have Ring1,Ring2 and Stick for the Arduino multi-tasking and only Ring1 for your code.
I will let you once I get everything working.
Could someone try loading it and see if it works.
Maybe it's my system, I don't know.
I think it was 1.6.4 that I used back then but it has been a while since I have looked.
I think what is happening is that you have to use a previous version of the Arduino IDE in order to compile the code from that long ago. I think the link above will take you to the version that you would have to use. The later post should work with a more current version of the IDE.
"The code below works with Arduino IDE 1.6.3 with the 1.0.3 version of the Adafruit NeoPixel library,"
If you want to change the pin that the arduino is connecting to the NeoPixel on, change the 2nd parameter in line 321. If you want to change the number of NeoPixles in the ring or device, change the first parameter in line 321.
is for a 24 pixel NeoPixel that has its input pin connected to pin 6 on the Arduino.
This will work with the plugin still. The commands don't change so there is no modification to the plugin.