How to repeat a non loop void ? [SOLVED]

nitrof:
many ways. one will be:

char state;

void example() {
 while('4' != state) { //if you read input from serial monitor it will be char type
   Serial.printlc("wait for you to press 4");
   state = Serial.read();//assuming you read intput from serial
   delay(100);
 }
}




Ond use code editor tag instead os screen shot.. It more easier to read.

its work sir, thank you so much, i can continue programming to the next level

thanks everyone :slight_smile: