I'm a neophyte Spinner.
I've got a Neopixel array hooked up to a prop and I can use Chip's neopixel driver code to test my hardware and things work, ie, I can change colors by manually changing this value in the code:
' Fill the grid with a white
repeat i from 0 to numPixels-1
pixels := $00_FF_FF_FF
I manually change those hex values and voila, colors change appropriately. cool!
but now I want to change those values with a variable and I can't figure out how to replace those hard-coded hex values with variables. So, here's my incorrect syntax for what I want to do:
repeat j from 0 to pulselength
fadefactor := j/pulselength
repeat i from 0 to (numPixels-1)
red := 256*fadefactor
green := 256*fadefactor
blue := 256*fadefactor
redh := fdx.Hex(red, 2)
grnh := fdx.Hex (green, 2)
bluh := fdx.Hex (blue, 2)
pixels := $00_grnh_redh_bluh
I hope that makes sense... the use of the fdx object (FullDuplexSerial) was my attempt to make hex values... how do I use variables for that pixels := statement?
Here's Chip's Neopixel object on the Obex:
thank you very much in advance!