Closed ivan-marroquin closed 4 years ago
Are you holding the button for at least ten seconds? The "if" at the beginning of your loop runs once per loop iteration, and since you run the motors for ten seconds, you have to hold it long enough to make sure it's being held at the time your loop checks for pressed buttons.
Hi @WasabiFan ,
Many thanks for the suggestion!
Ivan
uname -r
: 4.14.117-ev3dev-2.3.4-ev3dpkg-query -l {python3,micropython}-ev3dev*
ii python3-ev3dev 1.2.0 all Python language bindings for ev3devIn the Python script below, I would like the robot to play a wav file and stop moving when the left button is pressed. For some reason, the command to check when the left button is pressed doesn't work properly. To stop the script, I must press the backspace button.
Thanks for your help and suggestions. Below, you will find the script: