I've got 6 led's that are each connected to a microswitch and when there all on or "HIGH" I want to display "all locked" on a TFT screen but only when all are HIGH, I'm trying to do it using the "if" statement this is my text.. I'm sure you'll look at it and laugh but it shows you what I'm trying to achieve, also on a quick note, I'm also trying to stop it looping once I've displayed "All Locked" else it just keeps redrawing the screen... Many thanks..
void AllLock()
{
if (digitalRead(LED1) == HIGH && LED2 == HIGH && LED3 == HIGH && LED4 == HIGH && LED5 == HIGH && LED6 == HIGH)
If your code is within void loop() { } then it will repeat that endlessly whenever it has finished. Perhaps you might want to put some delayMicroseconds below it in loop(). The arduino compiler has that structure built in to it so that you never see anything called "main", similar to compiling
void main()
{
setup()
while(1) {loop();}
}
If your code is within void setup() { } then it will run once after poweron or the restart button is pressed.
That might be handy for testing.