So initially, it's set up here(?):
Code: Select all
Adafruit_DotStar::Adafruit_DotStar(uint16_t n, uint8_t data, uint8_t clock,
uint8_t o)
: numLEDs(n), dataPin(data), clockPin(clock), brightness(0), pixels(NULL),
rOffset(o & 3), gOffset((o >> 2) & 3), bOffset((o >> 4) & 3) {
updateLength(n);
}
Code: Select all
void Adafruit_DotStar::show(void) {
if (!pixels)
return;
uint8_t *ptr = pixels, i; // -> LED data
uint16_t n = numLEDs; // Counter
uint16_t b16 = (uint16_t)brightness; // Type-convert for fixed-point math
I see there's a pointer "*ptr = pixels" that takes each value for R, G, and B (later in the code)
Code: Select all
for (i = 0; i < 4; i++)
sw_spi_out(0); // Start-frame marker
if (brightness) { // Scale pixel brightness on output
do { // For each pixel...
sw_spi_out(0xFF); // Pixel start
for (i = 0; i < 3; i++)
sw_spi_out((*ptr++ * b16) >> 8); // Scale, write
} while (--n);
} else { // Full brightness (no scaling)
do { // For each pixel...
sw_spi_out(0xFF); // Pixel start
for (i = 0; i < 3; i++)
sw_spi_out(*ptr++); // R,G,B
} while (--n);
}
for (i = 0; i < ((numLEDs + 15) / 16); i++)
sw_spi_out(0xFF); // End-frame marker (see note above)
I seem to be missing something?
FYI....I'm referencing these two files:
https://github.com/adafruit/Adafruit_Do ... otStar.cpp
https://github.com/adafruit/Adafruit_Do ... _DotStar.h