2012-03-30, 11:08
@FocalFury, for 128 leds your prefix should give this:
41 64 61 00 7F 2A
To calculate your prefix you can use this Processing sketche:
41 64 61 00 7F 2A
To calculate your prefix you can use this Processing sketche:
Code:
int N_LEDS = 128; // Max of 65536
void setup()
{
byte[] buffer = new byte[6];
noLoop();
// A special header / magic word is expected by the corresponding LED
// streaming code running on the Arduino. This only needs to be initialized
// once because the number of LEDs remains constant:
buffer[0] = 'A'; // Magic word
buffer[1] = 'd';
buffer[2] = 'a';
buffer[3] = byte((N_LEDS - 1) >> 8); // LED count high byte
buffer[4] = byte((N_LEDS - 1) & 0xff); // LED count low byte
buffer[5] = byte(buffer[3] ^ buffer[4] ^ 0x55); // Checksum
print("Prefix for "+N_LEDS+" LEDS: ");
for(byte b : buffer)
print(" "+hex(b));
exit();
}