Staying in a subroutine

void loop() 
{
   if (digitalRead(setuppin) == HIGH)
   {
        setupmode();
        while (digitalRead(setuppin) == HIGH); //<========= add this
   }
   else 
   {
       runmode();
   }
}
1 Like