
Perry_S
USA
Asked
— Edited
Trying to work through the neopixel tutorial. Is this working for others? I can't get the Arduino sketch to compile with new and old versions of IDE.
Is this working for others or is the problem on my end.
Thanks
Neopixel Ring with ezb4
Also, you didn't include an error message that you're receiving.
I'm sure bob may chime in if he's around. But I'd start by reading the description and following the requirements that bob documented in his tutorial.
I am going to work on it a bit tonight and I will post more info with the specific errors I am receiving.
Excited to get this going because once it is that means that in a little over 1 month after receiving my EZB with no knowledge of it and being an amateur coder I will have recreated all of the MRL functionality I had after a year of working with that. And it actually works now.
As for the errors, share them and we'll get you running asap
Build it and they will come.
Wen I try to compile the sketch here is what I get.
Code:
Any ideas?
The tutorial is related to this thread:
http://www.ez-robot.com/Community/Forum/posts.aspx?threadId=6767
Can you try the code from post #67 (RobertL184)
And then there is a change/add-on post #68
What kind of arduino board you have ?
Code:
I am trying to figure out the #68 post as that may clear up the rest of the errors but I don't understand it yet.
I have a mega I am testing with. I have an uno if that is needed. I eventually want it to run on an adafruit pro trinket
#include <Adafruit_NeoPixel.h>
for some reason it doesn't show when the sketch is uploaded in the tutorial.
I see now that is missing from the tutorial script. I added it back in and I was back the page of errors. Oddly enough I can get the script from post #37 of the reference thread to compile. Are there differences between the two? or different functionality?
Thanks
Let's see if we can get it working.
If code formatting is giving you an issue, Upload the files as attached rather than pasting. I've mentioned this to you before. Simply press the attach file button. Select file, upload. Upload the files so they show as links. It's how I upload the source for big projects like plugin source etc.
Also, the tutorial update you made is missing the [/code] closing tag. See here: http://www.ez-robot.com/Tutorials/UserTutorials/150/1
Also, just to confirm, I am cutting and pasting the examples into the scripts I make with the script manager then running them. Is that the right way to activate it?
Now to go through the process of dumping the sketch from the tuto to it to see if I can get it to work. If not, I have this sketch backed up to my NAS and will get it for you.
From EZ-B
Ground on D5 to com port ground on Arduino
Signal on D5 to RX on Arduino
Power regulator- This is for the Mini Pro. Yours may be different depending on the arduino. The Neopixel needs 5V though.
5v to Neopixel ring +5v_PWR pin
5v to Arduino 5v pin
ground to Neopixel ring GND pin
ground to Arduino GND pin on Power side of the board
Arduino
Pin D6 to Input Pin on Neopixel Ring
Installed Arduino 1.6.3 from https://www.arduino.cc/download_handler.php?f=/arduino-1.6.3-windows.exe
- [EDIT] This script has been tested with version 1.1.1 of the Adafruit NeoPixel Library and works. This is the latest version of this library at the time of this writing so, you don't need to do this part. If you don't have the library installed, you can get it through the Arduino software or download it from GitHub at https://github.com/adafruit/Adafruit_NeoPixel
I am using the Adafruit NeoPixel by Adafruit version 1.0.4 library.
Adafruit_NeoPixel.zip
You will need to unzip the contents of the zip into your Arduino\libraries folder.
[/EDIT]
The code verifies. I also verified it with Arduino Uno (I use mini pro's) and it compiled.
Code:
Here is my sketch that I use. NeoPixelRingSerial2.zip
The zip file contains the sketch just in case a copy and paste doesn't work.
Code:
Code:
If you change the pin on the Arduino that is connecting to the NeoPixel, you need to adjust line 317 I think. I would have to dig through to make sure.
The baud rate for the arduino is set to 9600.
To test you can use this script if configured like I have described.
Code:
I have to step away for a bit. I will continue when I can
Line 317 also contains the number of pixels in the NeoPixel. If you have 8, the first number should be 8. If you have 16, the first number should be 16. Same with 24 and so on.
I did load this onto a new arduino mini pro using the information provided above, and then tested it in the Serial Monitor in Arduino. It worked by sending the commands at the top of the sketch. I then connected to a digital port on the EZ-B (in my case D0 to try something other than D5) and it worked by sending the commands via a script as shown above but replacing D5 with D0.
I think that there is a newer version of the script that uses newer Arduino stuff and newer NeoPixel libraries, but I haven't spent any time with them.
If you try the above steps and have any issues, let me know and I will help where I can.
Thanks
David
I updated the NeoPixel library through the Sketch, Include Library, Manage Library menu option.
The new library (1.1.1) also still works with the NeoPixel and the sketch provided above, so it isn't necessary to stay at the older 1.0.4 version of the NeoPixel library for this to work.
You can leave the arduino hooked up to the usb port and test some things out using it if you want to see how the NeoPixel reacts to the commands. You can also leave it disconnected and just use this to get the format of the commands.
To see the commands being sent to the NeoPixel, set the com port and then the number of pixels in the neopixel through the config page of the plugin.
From there, select the mode, and fill out the other fields that are enabled after selecting the mode. Click the Check mark at the bottom of the form if you want the command to be sent to the com port you specified to see the results of the settings you chose. Again, you don't have to have the connection established though to see the command that would go into the script for that action to be sent to the NeoPixel. It is just nice to also be able to see what that command looks like.
The bottom text box will display the command that you would enter into your script for this action.
https://synthiam.com/redirect/legacy?table=plugin&id=76 is the link to the plugin.
I loaded Arduino 1.8.3 and then loaded the project that RobertL184 provided to allow this to work with new versions of Arduino. https://www.ez-robot.com/Community/Forum/Thread?threadId=6767&page=7 post #67
Code:
When compiling, I get an error with the ColorWipe portion. Everything does compile and load to the Arduino Mini Pro. I was able to test all of the commands via the Arduino Serial Monitor and everything worked except for the Wipe portion. I will see if I can figure it out. If not, maybe Robert can chime in and let us know a fix.
Code:
to
Code:
Here is the working code. I have tested it out.
Code:
I can compile the new code and load. I have the Wiring holed up correctly to the EZB. I an not get a response. So I am down to Something in the serial connection.
I am using an Arduino micro. I assume this should work but some of the literature suggests it has TX peculiarities. So maybe that is it.
How should I be executing the sample codes? I am putting it into a script in the script manager and running it. Should I be doing this through a serial terminal or something?
Total success now. Thanks so much to everybody that helped. Great community over here.
So there was a problem with the tutorial script and a problem with me. Thanks for fixing the script David and +1 for making it such that I could dump that old Arduino version.
The problem with me was that I had the EZB connected to the TX of the Arduino and not the RX. I figured the Arduino was transmitting something to the ring. The wiring diagram in the tutorial is right. I just processed it wrong in my brain.
Thanks everyone for helping me get this far. This is a helpful forum and people stick around to see problems through
5 cheeseburgers for everyone involved.
Dave, it would be great if you could make a new tutorial on this topic.
Can't wait for the new Neo Pixel hardware from EZ-Robot!
I have 2 neopixels in my robot. I am experimenting with emotions and color patters. This is a great win for me. Maybe David will get around to making his plugin a fully functional control with tons of configuration options. He's busy so maybe between 1 and 3 AM next Tuesday.
4 Beers into the celebration of hitting my MRL functionality test. Now my guy does every function I had with the other software. Major milestone for me, The thing is, I don't really see the trajectory changing. I think it will just get better from here.
Happy Friday to all!
I don't know when I will get back to plugin development. When I do, I will basically be taking all of the pieces of EZ-AI that I had worked on for a couple of years, and make them plugins. Some of it I won't have to write again due to some amazing advances in plugin development. I am sure that I will revisit the NeoPixel plugin during this time, among others.
A new Tuto has been published. Hopefully it will help out some. The issue with a Tuto like this is that so many people can make a small change that breaks things. Arduino is the most likely to do this, so maintaining it becomes difficult unless you have someone tell you that it doesn't work. Yours is working great because at the time you wrote it, it worked. This is what Bob faced and I know it is frustrating. You are trying to offer something to the community and then it becomes a chore or job to keep it up to date. The last thing you want is people to run into issues following something that you wrote to help people out. The problem is that you have moved on because yours is working so you don't have a need to revisit it over and over, until you do.
Bob, I want to thank you for putting up your Tutorial. It did help a lot of people and the NeoPixel questions did drop for a while. Hopefully my Tutorial can help as many people as yours did.
#include <Adafruit_NeoPixel.h>
That's the same problem I had, there is another way to upload the sketch so it shows but I don't know how to do it.