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

Function executeToggles

examples/RX/test.cpp:36–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

34}
35
36void executeToggles(fl::RxChannel& rx,
37 fl::span<const PinToggle> toggles,
38 int pin_tx,
39 uint32_t wait_ms) {
40 const fl::RxChannelConfig& config = rx.config();
41
42 // Set pin to initial state before begin()
43 pinMode(pin_tx, OUTPUT);
44 digitalWrite(pin_tx, config.start_low ? LOW : HIGH);
45 fl::delayMicroseconds(100); // Allow pin to settle
46
47 // Initialize RX channel
48 if (!rx.begin(config)) {
49 FL_ERROR("Failed to initialize RX channel");
50 return;
51 }
52
53 // Execute pin toggles
54 for (size_t i = 0; i < toggles.size(); i++) {
55 digitalWrite(pin_tx, toggles[i].is_high ? HIGH : LOW);
56 fl::delayMicroseconds(toggles[i].delay_us);
57 }
58}
59
60bool validateEdgeTiming(fl::span<const fl::EdgeTime> edges,
61 size_t edge_count,

Callers

nothing calls this directly

Calls 6

configMethod · 0.80
pinModeFunction · 0.50
digitalWriteFunction · 0.50
delayMicrosecondsFunction · 0.50
beginMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected