Variable not receiving value

Asked

Viewed 47 times

0

I have a program, where when I click a button the program pauses, and when I click again it continues, but I realized that in that period of time when I pause the program, the variable that I want receives value even being in pause, how do I make it not receive value while the program is in pause. Code:

  if (digitalRead(botao)==1){
   for(;;){
     if (digitalRead(botao)==1){
     goto programa;
  }
}

1 answer

0

I’m not sure it’s going to work, but try to put a system("pause"):

if (digitalRead(botao)==1){
  for(;;){
    if (digitalRead(botao)==1){
    goto programa;
 }
}
//Se der erro na utilizacao do system("pause") mete a biblioteca -> stdlib.h
system("pause")

Browser other questions tagged

You are not signed in. Login or sign up in order to post.