In my opinion, the reason why does this phenomenon occur is that "A" button hysteresis remains. Don't you use "button()" before "input"? Please try to insert codes as follows before "input". REPEAT VSYNC 1 UNTIL(BUTTON(0)AND #A)==0