Sending a Pulse

Hi Colaboy,

You can simplify your code like this:

  // Compare the buttonState to its previous state
  if (buttonState1 != lastButtonState1) {  // if the state has changed,
    
      digitalWrite(ledPin1, HIGH);  // Turn LED 1 on
      delay(250);                   // Wait quarter of a second
      digitalWrite(ledPin1, LOW);   // Turn LED 1 off

      lastButtonState1 = buttonState1;    // Save the current state of button 1 as the last state 1
  }

You had something like if (X) do this, else do the same.

Regards,
Jim