FastLED 3.9.15
Loading...
Searching...
No Matches

◆ showPixels()

template<uint8_t DATA_PIN, EOrder RGB_ORDER = GRB>
virtual void WS2816Controller< DATA_PIN, RGB_ORDER >::showPixels ( PixelController< RGB_ORDER, LANES, MASK > & pixels)
inlineoverridevirtual

Send the LED data to the strip.

Parameters
pixelsthe PixelController object for the LED data

Implements CPixelLEDController< GRB, WS2812Controller800Khz< DATA_PIN, RGB >::LANES_VALUE, WS2812Controller800Khz< DATA_PIN, RGB >::MASK_VALUE >.

Definition at line 1168 of file chipsets.h.

1168 {
1169 // Ensure buffer is large enough
1171
1172 // expand and copy all the pixels
1173 size_t out_index = 0;
1174 while (pixels.has(1)) {
1175 pixels.stepDithering();
1176
1177 uint16_t s0, s1, s2;
1178 pixels.loadAndScale_WS2816_HD(&s0, &s1, &s2);
1179 uint8_t b0_hi = s0 >> 8;
1180 uint8_t b0_lo = s0 & 0xFF;
1181 uint8_t b1_hi = s1 >> 8;
1182 uint8_t b1_lo = s1 & 0xFF;
1183 uint8_t b2_hi = s2 >> 8;
1184 uint8_t b2_lo = s2 & 0xFF;
1185
1187 mData[out_index + 1] = CRGB(b1_lo, b2_hi, b2_lo);
1188
1189 pixels.advanceData();
1190 out_index += 2;
1191 }
1192
1193 // ensure device controller won't modify color values
1194 mController.setCorrection(CRGB(255, 255, 255));
1195 mController.setTemperature(CRGB(255, 255, 255));
1196 mController.setDither(DISABLE_DITHER);
1197
1198 // output the data stream
1199 mController.setEnabled(true);
1200#ifdef BOUNCE_SUBCLASS
1201 mController.callShow(mData, 2 * pixels.size(), 255);
1202#else
1203 mController.show(mData, 2 * pixels.size(), 255);
1204#endif
1205 mController.setEnabled(false);
1206 }
virtual int size()
How many LEDs does this controller manage?

References PixelController< RGB_ORDER, LANES, MASK >::advanceData(), DISABLE_DITHER, ensureBuffer(), PixelController< RGB_ORDER, LANES, MASK >::has(), PixelController< RGB_ORDER, LANES, MASK >::loadAndScale_WS2816_HD(), mController, mData, PixelController< RGB_ORDER, LANES, MASK >::size(), and PixelController< RGB_ORDER, LANES, MASK >::stepDithering().

+ Here is the call graph for this function: