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();
}
}
if (ignition_mode == HIGH);
does nothing, because;
is an empty statement performed if the condition is true. \$\endgroup\$}
is missing \$\endgroup\$