-
Hi, I am looking at the code on this page for the 42109 rally car: Everything works fine, but I would like to use the red left button to set the speed to 50%, and use the red right button to set the speed to 100%. Rather than having the speed change while the buttons are pressed, I would like just a press of the button to change the speed to the new value where it would remain until the other button is pressed. How can I do this? |
Beta Was this translation helpful? Give feedback.
Answered by
dlech
Nov 9, 2022
Replies: 1 comment 12 replies
-
Something like this? if Button.LEFT in pressed:
drive_speed = top_speed // 2
if Button.RIGHT in pressed:
drive_speed = top_speed |
Beta Was this translation helpful? Give feedback.
12 replies
Answer selected by
rcodecom
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Something like this?