Can't the key be detected in the loop?


I cant print “break”

Try putting a pause(0) in the while loop at the very end. So instead of:

while <true> do:
    if B button pressed:
        break

Do:

while <true> do:
    if B button pressed:
        break
    pause for 0 ms
2 Likes

Thank you very much. This code works

2 Likes