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

◆ setMixedBitPattern()

void setMixedBitPattern ( CRGB * leds,
size_t count,
int pattern_id )

Definition at line 1208 of file AutoResearchTest.cpp.

1208 {
1209 switch (pattern_id) {
1210 case 0:
1211 // Pattern A: R=0xF0 (high nibble), G=0x0F (low nibble), B=0xAA (alternating)
1212 // Tests: High bits in R, low bits in G, mixed bits in B
1213 for (size_t i = 0; i < count; i++) {
1214 leds[i] = CRGB(0xF0, 0x0F, 0xAA);
1215 }
1216 break;
1217
1218 case 1:
1219 // Pattern B: R=0x55 (alternating 01010101), G=0xFF (all high), B=0x00 (all low)
1220 // Tests: Alternating bits, all-high boundary, all-low boundary
1221 for (size_t i = 0; i < count; i++) {
1222 leds[i] = CRGB(0x55, 0xFF, 0x00);
1223 }
1224 break;
1225
1226 case 2:
1227 // Pattern C: R=0x0F (low nibble), G=0xAA (alternating), B=0xF0 (high nibble)
1228 // Tests: Rotated pattern from A, ensures driver handles different channel values
1229 for (size_t i = 0; i < count; i++) {
1230 leds[i] = CRGB(0x0F, 0xAA, 0xF0);
1231 }
1232 break;
1233
1234 case 3:
1235 // Pattern D: Solid colors alternating (Red, Green, Blue repeating)
1236 // Baseline test - ensures basic RGB transmission works
1237 for (size_t i = 0; i < count; i++) {
1238 int color_index = i % 3;
1239 if (color_index == 0) {
1240 leds[i] = CRGB::Red; // RGB(255, 0, 0)
1241 } else if (color_index == 1) {
1242 leds[i] = CRGB::Green; // RGB(0, 255, 0)
1243 } else {
1244 leds[i] = CRGB::Blue; // RGB(0, 0, 255)
1245 }
1246 }
1247 break;
1248
1249 default:
1250 // Fallback: all black
1251 fill_solid(leds, count, CRGB::Black);
1252 break;
1253 }
1254}
fl::CRGB leds[NUM_LEDS]
void fill_solid(CRGB *targetArray, int numToFill, const CRGB &color) FL_NOEXCEPT
Fill a range of LEDs with a solid color.
Definition fill.cpp.hpp:9
fl::CRGB CRGB
Definition crgb.h:25
@ Green
<div style='background:#008000;width:4em;height:4em;'></div>
Definition crgb.h:558
@ Red
<div style='background:#FF0000;width:4em;height:4em;'></div>
Definition crgb.h:622
@ Blue
<div style='background:#0000FF;width:4em;height:4em;'></div>
Definition crgb.h:512
@ Black
<div style='background:#000000;width:4em;height:4em;'></div>
Definition crgb.h:510

References fl::CRGB::Black, fl::CRGB::Blue, fill_solid(), fl::CRGB::Green, leds, and fl::CRGB::Red.

Referenced by autoResearchChipsetTiming(), and autoResearchChipsetTimingLegacy().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: