public void timerCallback()
{
if (count < 8)
{
System.out.println("My timer woke up!");
this.setOutputState(this.pinNumber, this.pinState);
this.pinState = !this.pinState;
this.setTimer(this.timerDelay);
count++;
}else
{
this.stopMonitoring();
}
}
That works in the sense that it prints the statement (with the delay) 8 times then terminates the program. Now this:
public void timerCallback()
{
while (count < 8)
{
System.out.println("My timer woke up!");
this.setOutputState(this.pinNumber, this.pinState);
this.pinState = !this.pinState;
this.setTimer(this.timerDelay);
count++;
}
this.stopMonitoring();
}
That code just prints the statement 8 times at once, then terminates. Why is that?