6. Case 04: Obstacles-avoidance Cars#

6.1. Purpose#

To make an obstacle-avoidance car.


6.3. Materials Required#


Video link: https://youtu.be/jYkSCfRpj1Y

6.4. Bricks build-up#









6.5. Installation Mthods of Hardwares#

Install the sonar:bit with the bricks.


6.6. Hardware Connection#

Connect two motors to M1, M2, and the sonar:bit to P1 port on Wukong breakout board.


6.7. Software Platform#


6.8. Coding#

Add extensions#

Click “Advanced” in the MakeCode to see more choices.


Search with Wukong in the dialogue box to download it.


Search with https://github.com/elecfreaks/pxt-sonarbit in the dialogue box to add the sonar:bit extension.





6.9. Result#

While on start, the car moves forward at the full speed and it turns right if it detects any obstacles within the scope of 20cm, and then it keeps moving forward.