Commands sent from the EZ-B to the Arduino
The top portion of the sketch contains all of the commands that the Arduino can accept. Some commands take more parameters than others. Below are the comments that are in the script which outline each command and its needed parameters.
/ Serial Commands
/ Cr1,g1,b1 - Set whole Ring to same color specified by r1,g1,b1
/ Rt,d - Rainbow with interval t and direction d
/ Tr1,g1,b1,r2,g2,b2,t,d - Theater Chase between color r1,g1,b1 and color r2,g2,b2 with interval t and direction d
/ Wr1,g1,b1,t,d - Color Wipe in color r1,g1,b1 with interval t and direction d
/ Fr1,g1,b1,r2,g2,b2,s,t,d - Fade between color r1,g1,b1 and color r2,g2,b2 in s steps with interval t and direction d
/ Sr1,g1,b1,t - Scanner with color specified by r1,g1,b1 and interval t
/ Pp,r1,g1,b1 - Set individual pixel p to color specified by r1,g1,b1
/
/ p = pixel number
/ r1 = 1st color red values 0 to 255
/ g1 = 1st color greern values 0 to 255
/ b1 = 1st color blue values 0 to 255
/ r2 = 2nd color red values 0 to 255
/ g2 = 2nd color greern values 0 to 255
/ b2 = 2nd color blue values 0 to 255
/ s = number of steps
/ t = interval time values 0 to 255
/ d = direction 0 = Forward 1 = Backward
*/
If you used the wiring section that I provided, you should be able to use this example script in ARC to run through a few of the different modes for the NeoPixel.
This command will send a serial command from digital pin 5 at 9600 baud of "C100,1,1" which will turn the ring red.
sendserial( D5, 9600, "C100,1,1")
This command will send a serial command from digital pin 5 at 9600 baud of "R20.0" which will make a rainbow effect.
sendserial( D5, 9600, "R20,0")
This command will send a serial command from digital pin 5 at 9600 baud of "T100,1,1,1,100,1,20,0" which will make a a theater chase effect.
sendserial( D5, 9600, "T100,1,1,1,100,1,20,0")
With these examples, you should be able to see how the parameters are passed and used.
To turn off the NeoPixel, just send a command of C0,0,0 to the controller. This sets all pixels to off.
sendserial( D5, 9600, "C0,0,0")
Will this work for LED strips?
Are they neopixel led strips? Then yes. If they’re not then, no.
With this set up....is it NOT possible to use dynamixels at same time as the Neopixels, because they both use D5?
There’s 3 uart on the EZ-B v4. Which means you can use Dynamixels by having this run on a different port.
Maybe I’ll demonstrate neopixelon next hack night if you’d like?
That would be fantastic!
Okay - subscribe and tune in here: https://synthiam.com/HackEvent/DJ-s-6th-Live-Hack-Event-Raspberry-Pi--17601
I know we all ran outta juice on Friday night, so do you think you could cover this on the next Hack?
Yeah i can do that
Thank you DJ for taking the time last night to dig into Arduino and Neopixel. Last nights session really helped a lot.
I am interested in the schematics and firmware of the NeoPixel Blaster.
PS. I learned so much just watching you navigate through coding and such on the live stream. I hope to see many more Live Hacks.
Live-Hack-NeoPixel-Arduino-Raspberry-Pi-EZBPi-Server
Thanks,
Mark