I have a while loop which checks for the rising edge of the variable Accessory2. My code is the following:
# Check for rising edge of ACC2
while (currentTime.Value - StartTime) < TimeOutValue:
if Accessory2.Value == 1:
Acc2StartTime = currentTime.Value
print rttPrefix + "ACC2 output to ON"
break
yield None
else:
print rttPrefix + "No ACC2 output"
DynamicFlag.Value = -2
However, when the variable Accessory2 goes up, the break condition stops the if statement but the else statement is also executed. Any idea why ?
The output is the following:
*RTT:* ACC2 output to ON
*RTT:* No ACC2 output