Case 09: Automatic Doors
To make an automatic door.
Video link: https://youtu.be/JimDF7ArSjQ
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.
When the ultrasonic sensor detects someone passing by, it will display √ on the micro:bit and control the servo to open the door and close it automatically after 5 seconds, if the ultrasonic sensor does not detect anyone, it will keep displaying × on the micro:bit and the door is closed.