DNB Coding Challenge Snippet #1

PHOTO EMBED

Wed Mar 20 2024 20:55:27 GMT+0000 (Coordinated Universal Time)

Saved by @TechBox #c++

  // Challenge Solution - Part #1
  // Cascading "if" statement to turn switches "ON" if they are "OFF"
  // The PULLUP configuration means that a "LOW" signal equals the switch being "ON",
  // while a "HIGH" signal equals the switch being in the "OFF" position
  if (digitalRead(sw1Pin) == HIGH) {
    delay(250);
    flipSwitch(sw1Pos);
  } 
content_copyCOPY