Use math, logic, loops, variables and discover more programming concepts
All programming blocks are on the left panel. Drag & drop an event block in the programming area. Then, drag & drop action blocks inside the event block. Press Play.
Press the forward button multiple times to make Thymio accelerate
First let’s set the value of the “speed” variable to 0
We create a subroutine called “checkSpeed” that will check the value of the “speed” variable and set the motors speed accordingly. When the “speed” variable value is equal to 3, we set its value to -1 so the next time the forward button is pressed the value will be 0 again
We use the “on forward button touched” event to increment the value of the “speed” variable and to call the “checkSpeed” subroutine
You have 3 different speed levels. If you press one more time the forward button, Thymio will stop. If you press it again, Thymio will go back to the first speed level.
Describe your issue
Enter your details