General area when it fits no where else

Moderator: Mmiscool

User avatar
By Electroguard
#66481 I've read the doc entry many times and tried different values in the example, but I still can't understand what the instruction is supposed to do or what is being copied where or why, nor even what format the pixel data is in (it's not simply the hex R G B components) ... so can anyone explain what the Neo.HEX command does and how to use it, please?
neo.hex({pixel data],{start pixel],int{Position in pixel data},{number pixels},{brightness 0-100})
Will use the string , starting at the start of the string copy it to the start of the neopixel display, copy 2 pixels, at 10% brighness.
User avatar
By Electroguard
#66503 Thanks, it makes a bit more sense for manipulating pixels in a 16 x 16 grid than it did for a string.

There's a couple of neo entries with slight omissions, I've added my best guess of the missing info and changes in colour in case it helps...

Will set the desired pixel led to the color specified with an RGB (Red, Green, Blue) value. No optional last parameter will cause pixels to be written instantly. You can optionally disable instant writing to the neo pixel by using a 1 in the last parameter. This will allow for many pixels to be updated all at once. Use a 0 in the last parameter to simultaneously write all buffered pixels.

neo({LED NO},{R},{G},{B},{optional. Set to 1 disable auto write, set to 0 to write buffered contents})

neo(3,250,250,250) ‘ write to pixel 3 instantly
neo(4,250,250,250,1) ‘buffer pixel 4 for synchronised write later.
neo(5,250,250,250, 0) 'write pixel 5 plus all buffered pixels simultaneously.

NEO.SHIFT() seems to be referring to a missing example
neo.shift({start pixel},{end pixel},{direction, 1 for forward, -1 for reverse.})
Will display a shift effect. This allows some nice scrolling animations with very little effort.

Will move all the pixels from 0 to 20 up one.