Hello, i want to do when I push the button right led red, again i push the button on the robot left led red. I thin this code rigt it works sometimes not consisting.
Button on robot
My apologies, I can’t understand the labels on all of the code (English is my primary language). When testing for a pushbutton press, you may want to have a momentary pause between each iteration of the loop to act as a kind of “debounce” for the button. Normally, I’d assign the value received from reading the pushbutton to a variable and then use an if-else statement to control the actions based on the value of the variable. At the end of the loop, you might try putting a short wait statement, say 10-20ms before doing another read.
system
#3
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.