- The Cutebot avoids the obstacles automatically to move forward.
- 1 x Cutebot Kit
- 1 x Ultrasonic Sensor
- 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
Cutebot
in 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.
- Drag "go straight at full speed" brick into the
On start
brick.
- Set a
Sonar
variable to save the detectedCm
value in theForever
brick. - If the detected value is between
2
and20
which means there is obstacle being detected in the front 20cm far, set the left wheel speed to0
and right to-50
, make a right turn at a random time to complete an obstacle avoidance. - If not, move forward at its full speed.
Links: https://makecode.microbit.org/_TaE1uEVfvb8z
You can also download it directly below:
<iframe style="position:absolute;top:0;left:0;width:100%;height:100%;" src="https://makecode.microbit.org/#pub:https://makecode.microbit.org/_TaE1uEVfvb8z" frameborder="0" sandbox="allow-popups allow-forms allow-scripts allow-same-origin">
</iframe>
- The Cutebot moves forward at its full speed and will make a right turn to keep going if any obstacle being detected.
- Why should the detected value be over 2cm ?
Q: After connecting the Sonar:bit, the Cutebot doesn't work.
A: Please have a check on the connections of the Sonar:bit, make sure that you connect to the SR04 connection rather than the IIC.