27. Case 27: The Smart Garbage Can#

27.1. Purpose#


Make a smart garbage can.

../../_images/Wonder-Building-Kit-case-27-01.png

27.3. Materials Required#


../../_images/Wonder-Building-Kit-step-case-27-01.png

27.4. Bricks build-up#


../../_images/Wonder-Building-Kit-step-case-27-02.png

../../_images/Wonder-Building-Kit-step-case-27-03.png

../../_images/Wonder-Building-Kit-step-case-27-04.png

../../_images/Wonder-Building-Kit-step-case-27-05.png

../../_images/Wonder-Building-Kit-step-case-27-06.png

../../_images/Wonder-Building-Kit-step-case-27-07.png

../../_images/Wonder-Building-Kit-step-case-27-08.png

../../_images/Wonder-Building-Kit-step-case-27-09.png

../../_images/Wonder-Building-Kit-step-case-27-10.png

../../_images/Wonder-Building-Kit-step-case-27-11.png

../../_images/Wonder-Building-Kit-step-case-27-12.png

../../_images/Wonder-Building-Kit-step-case-27-13.png

../../_images/Wonder-Building-Kit-step-case-27-14.png

../../_images/Wonder-Building-Kit-step-case-27-15.png

../../_images/Wonder-Building-Kit-step-case-27-16.png

../../_images/Wonder-Building-Kit-step-case-27-17.png

../../_images/Wonder-Building-Kit-step-case-27-18.png

../../_images/Wonder-Building-Kit-step-case-27-19.png

../../_images/Wonder-Building-Kit-step-case-27-20.png

../../_images/Wonder-Building-Kit-step-case-27-21.png

../../_images/Wonder-Building-Kit-step-case-27-22.png

../../_images/Wonder-Building-Kit-step-case-27-23.png

../../_images/Wonder-Building-Kit-step-case-27-24.png

../../_images/Wonder-Building-Kit-step-case-27-25.png

../../_images/Wonder-Building-Kit-step-case-27-26.png

../../_images/Wonder-Building-Kit-step-case-27-27.png

../../_images/Wonder-Building-Kit-step-case-27-28.png

../../_images/Wonder-Building-Kit-step-case-27-29.png

../../_images/Wonder-Building-Kit-step-case-27-30.png

../../_images/Wonder-Building-Kit-step-case-27-31.png

27.5. Hardware Connection#

将一个舵机连接到悟空扩展板的S1接口,将超声波传感器连接到悟空扩展板的P0接口.

../../_images/Wonder-Building-Kit-case-27-06.png

27.6. Software Platform#


MakeCode

27.7. Coding#


Add extensions#

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

../../_images/Wonder-Building-Kit-case-21-02.png

Search with Wukong in the dialogue box to download it.

../../_images/Wonder-Building-Kit-case-21-03.png

Search with IOT:bit in the dialogue box to download it.

../../_images/Wonder-Building-Kit-case-27-04.png

Program#

../../_images/Wonder-Building-Kit-case-27-05.png

Link:https://makecode.microbit.org/_XeMXzj7z3JFx