I have been working on this for a while. It is a small part of a much bigger code.
I have a digital input pin connected to a on/off switch and another input pin connected to a momentary push button. For the momentary push button I am using the onebutton library. It works great.
I am trying to make it so the momentary push button does nothing unless the on off switch connected to a digital pin if switched on or HIGH. For some reason the momentary push button still gets read and my program runs regardless of whether the switch is swichted or not.
void loop()
{
ignition_mode = digitalRead(ignition);
if (ignition_mode == HIGH);
{
button.tick();
}
}
Best Answer
If you format you code properly, you can see that it does not what you intended:
You most likely intended: