In my TLC5940 adventures Ive come across an oddity, when setting an animation array structure using the GS_DUO macro Ive found that values above 1024 start lighting up the second LED, from the documentation it should have a range of 0-4095.
No not seen that at all. As the control range is 12 bits a byte and a half are used for each LED. If you get the algorithm wrong you could be putting the data into the wrong place.
yeah thats what I thought, but in this case Im using the macro from the example, so I shouldn`t be able to mess that up, maybe his macro is buggy.
/** Arranges 2 grayscale values (0 - 4095) in the packed array format (3 bytes).
This is for array initializers only: the output is three comma seperated
8-bit values. */ #define GS_DUO(a, b) ((a) >> 4), ((a) << 4) | ((b) >> 8), (b)
Yes if the values going in as a & b are bigger than 255 then it will give trouble. Not sure a cast would help be certainly a val &= 0xff to limit the value to 255 might no go amiss.