Hi all, I am new to programing.
I am in trouble with a simple patch. What I am trying to achieve is:
Watching button state, printing high or low, if low for some time do series of messages. What my problem is, I want to brake the for loop witch send the messages if press the button. I have read some references about attachInterrupt(), but I am not sure that this is my problem actually.
here is my patch:
checki() won’t be called. Anything after the break statement is a waste of time. That code is unreachable. Once you hit the break you leave the whole block.
Sure you can. To stop a for loop and pick up with the next iteration use continue. To kill the for loop entirely use break. But any code inside the loop and after that break statement won't be run. When you break the for loop you leave it entirely. That last line in the else clause is after the break line. So if you hit the break you leave that block entirely, how will you ever get to that last line?