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

Function verifyJumperWire

examples/RX/test.cpp:7–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5#include "test.h"
6
7bool verifyJumperWire(int pin_tx, int pin_rx) {
8 FL_WARN("Verifying jumper wire connection between GPIO " << pin_tx << " and GPIO " << pin_rx << "...");
9
10 pinMode(pin_tx, OUTPUT);
11 pinMode(pin_rx, INPUT);
12
13 // Test HIGH
14 digitalWrite(pin_tx, HIGH);
15 delay(1); // Allow signal to propagate
16 int rx_high = digitalRead(pin_rx);
17
18 // Test LOW
19 digitalWrite(pin_tx, LOW);
20 delay(1); // Allow signal to propagate
21 int rx_low = digitalRead(pin_rx);
22
23 if (rx_high != HIGH || rx_low != LOW) {
24 FL_ERROR("Jumper wire sanity check FAILED!");
25 FL_ERROR(" digitalWrite(TX=" << pin_tx << ", HIGH) → digitalRead(RX=" << pin_rx << ") = " << rx_high << " (expected HIGH=1)");
26 FL_ERROR(" digitalWrite(TX=" << pin_tx << ", LOW) → digitalRead(RX=" << pin_rx << ") = " << rx_low << " (expected LOW=0)");
27 FL_ERROR("");
28 FL_ERROR("REQUIRED: Physically connect GPIO " << pin_tx << " to GPIO " << pin_rx << " with a jumper wire!");
29 return false;
30 }
31
32 FL_WARN("✓ Jumper wire verified: GPIO " << pin_tx << " → GPIO " << pin_rx << " signal path working");
33 return true;
34}
35
36void executeToggles(fl::RxChannel& rx,
37 fl::span<const PinToggle> toggles,

Callers

nothing calls this directly

Calls 4

pinModeFunction · 0.50
digitalWriteFunction · 0.50
delayFunction · 0.50
digitalReadFunction · 0.50

Tested by

no test coverage detected