request sketch for relay with button up/down (no push button)
-
@rayan said:
If i do understand you correctly you want to toggle the relay when the switch is toggled regardless which state it is in?
If so just remove the && state == LOW and the relay whill be toggled each time stateChagened togglesif ( stateChanged ) { if ( ledState == LOW ) { ledState = HIGH; } else { ledState = LOW; }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login