5. Case 02: Speed Up Gradually¶
In case 01, we can find the Cutebot moves too fast to go steadily(the universal wheel goes off the ground) at the beginning.
We will learn to gradually speed up the car for a steady move at the beginning in this case.
Click the “Advanced” to see more choices in the MakeCode drawer.
A codebase is required for Cutebot programming, click “Add Package” at the bottom of the drawer, search
Cutebotin the dialogue box and download it.
Note: If you met a tip indicating incompatibility of the codebase, you can continue with the tips or build a new project there.
Choose “show icon” in the
speedvariable to 0 which means the on start speed is 0.
Drag setting speed bricks for left and right wheel and set the value as
speedin “forever” brick, then add one to
100which is the maximum speed, set
speedto 0 and restart it.
The Cutebot speeds up gradually and the universal wheel will not go off the ground due to the high speed.
How to program to make the car speed up gradually and then speed down gradually?