I'd like to run a block of code interspersed throughout a program and rather than making a mess in the program I'd like to define it as a variable. I'm not sure if that's the right terminology but I'd like to represent
with a single word/variable etc. Is that possible? It'd make my program much cleaner and easier to follow if I don't have to tack this mess in everywhere I need it.Code:// read the state of the Relay value: buttonState = digitalRead(buttonPin); // check if the Relay is on. // if it is, the buttonState is HIGH: if (buttonState != HIGH) { break; } // exit program
thanks in advance for any advice!!