Case 04: Obstacles-avoidance Cars
To make an obstacle-avoidance car.
Video link: https://youtu.be/jYkSCfRpj1Y
Installation Mthods of Hardwares
Install the sonar:bit with the bricks.
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.
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.