Moderators: adafruit_support_bill, adafruit
static final int coord[][] = new int[][] {
{3,5}, {2,5}, {1,5}, {0,5}, // Bottom edge, left half
{0,4}, {0,3}, {0,2}, {0,1}, // Left edge
{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0}, {8,0}, // Top edge
{8,1}, {8,2}, {8,3}, {8,4}, // Right edge
{8,5}, {7,5}, {6,5}, {5,5} // Bottom edge, right half
};
static final int arrayWidth = 9, // Width of Adalight array, in LED pixels
arrayHeight = 6, // Height of Adalight array, in LED pixels
imgScale = 20, // Size of displayed preview
samples = 20, // Samples (per axis) when down-scaling
s2 = samples * samples;static final int coord[][] = new int[][] {
{8,8}, {7,8}, {6,8}, {5,8}, {4,8}, {3,8}, {2,8}, {1,8}, {0,8}, // Bottom edge, left half
{0,7}, {0,6}, {0,5}, {0,4}, {0,3}, {0,2}, {0,1}, // Left edge
{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}, {6,0}, {7,0}, {8,0}, {9,0}, {10,0}, {11,0}, {12,0}, {13,0}, {14,0}, {15,0}, {16,0}, {17,0}, // Top edge
{17,1}, {17,2}, {17,3}, {17,4}, {17,5}, {17,6}, {17,7}, // Right edge
{17,8}, {16,8}, {15,8}, {14,8}, {13,8}, {12,8}, {11,8}, {10,8}, {9,8} // Bottom edge, right half
};
static final int arrayWidth = 18, // Width of Adalight array, in LED pixels
arrayHeight = 9, // Height of Adalight array, in LED pixels
imgScale = 20, // Size of displayed preview
samples = 20, // Samples (per axis) when down-scaling
s2 = samples * samples;jeffre wrote:If you are willing to compile the newest boblight you can get it working right with the adalight.pde out of the box by using the prefix feature (prefix 41 64 61 00 18 4D)
int N_LEDS = 25; // 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();
}pburgess wrote:Regarding the flickering: the WS2801 LED driver chip is somewhat unique...
illiac4 wrote:Did you contacted bob1on1 if he is going to make it for windows too?
jeffre wrote:I wish someone could make the newest version of boblight into a windows executable.
./configure --without-portaudio buffer[0] = 'A'; // Magic word
buffer[1] = 'd';
buffer[2] = 'a';
buffer[3] = byte((coord.length - 1) >> 8); // LED count high byte
buffer[4] = byte((coord.length - 1) & 0xff); // LED count low byte
buffer[5] = byte(buffer[3] ^ buffer[4] ^ 0x55); // Checksum
pburgess wrote:Regarding the checksum, here's the relevant bit from the Processing sketch:
- Code: Select all
buffer[0] = 'A'; // Magic word
buffer[1] = 'd';
buffer[2] = 'a';
buffer[3] = byte((coord.length - 1) >> 8); // LED count high byte
buffer[4] = byte((coord.length - 1) & 0xff); // LED count low byte
buffer[5] = byte(buffer[3] ^ buffer[4] ^ 0x55); // Checksum
Bytes 0-2 are the magic word "Ada". Bytes 3 and 4 are the high byte and low byte of the 16-bit LED count (minus 1...so for 25 LEDs, this will contain the value 24, or 0x0018 hexadecimal). The checksum equals the high byte XOR the low byte XOR 0x55...in the 25 LED case again, this would be 0x4D. For 50 LEDs, it would be 0x64.
Return to Glowy things (LCD, LED, TFT, EL) purchased at Adafruit
Users browsing this forum: DoctorDidj, ledsrcool, mibignistinly and 8 guests