do something once inside repeat
xanadu
Posts: 3,347
I have this code using the LCD object and it's monitoring pin 1 of the prop. Having the LCD output in the monitor loop constantly refreshes the display. How would I make this only change the display if the pin input changes instead of refreshing each loop?
repeat if ina[1] == 1 lcd.backlight(true) lcd.clrln(1) lcd.gotoxy(0, 1) lcd.str(string("Off")) if ina[1] == 0 lcd.backlight(true) lcd.clrln(1) lcd.gotoxy(0, 1) lcd.str(string("On"))
Comments
You need to keep track of the previous state of the pin.
-Phil
best regards Stefan
Thanks but the avatar was not my idea, a knock off version if you will hehe.
@PhiPi - Great input, I see I would need to do that for my code and will, thanks.