when I run a while (true) inside a thread
It only works if the condition play = 1 is met in the beginning.
but if play = 0 in the beginning, in the future of the program when play == 1 what is inside while is not running, I thought it should be executed since while (true) is waiting for instructions.
How do I make while (true) work at any time and not just in the beginning.
//variable init
play=0
void setup(){
thread("holo");
}
void holo(){
while(true){
if (play==1){
//...//it does not run because play 0 was initialized with 0
//but it does not run in the future when play = 1;
}
}
}