MCPcopy Create free account
hub / github.com/FastLED/FastLED / encodeWS2801

Function encodeWS2801

src/fl/chipsets/encoders/ws2801.h:41–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

39/// @note WS2801 uses RGB wire order: pixel[0]=Red, pixel[1]=Green, pixel[2]=Blue
40template <typename InputIterator, typename OutputIterator>
41void encodeWS2801(InputIterator first, InputIterator last, OutputIterator out) FL_NOEXCEPT {
42 while (first != last) {
43 const array<u8, BYTES_PER_PIXEL_RGB>& pixel = *first;
44 *out++ = pixel[0]; // Index 0 (RGB order: Red)
45 *out++ = pixel[1]; // Index 1 (RGB order: Green)
46 *out++ = pixel[2]; // Index 2 (RGB order: Blue)
47 ++first;
48 }
49 // No end frame needed - WS2801 latches via timing (clock pause)
50}
51
52} // namespace fl

Callers 4

encodeWS2803Function · 0.70
writeWS2801Method · 0.70
ws2803.hppFile · 0.50
ws2801.hppFile · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected