# Case 26: The Corsair ## Purpose --- Make a corsair. ![](./images/Wonder-Building-Kit-case-26-01.png) ## Link: --- [micro:bit Wonder Building Kit](https://shop.elecfreaks.com/products/elecfreaks-micro-bit-32-in-1-wonder-building-kit-without-micro-bit-board?_pos=5&_sid=2094afd2f&_ss=r) ## Materials Required --- ![](./images/Wonder-Building-Kit-step-case-26-01.png) ## Bricks build-up --- ![](./images/Wonder-Building-Kit-step-case-26-02.png) ![](./images/Wonder-Building-Kit-step-case-26-03.png) ![](./images/Wonder-Building-Kit-step-case-26-04.png) ![](./images/Wonder-Building-Kit-step-case-26-05.png) ![](./images/Wonder-Building-Kit-step-case-26-06.png) ![](./images/Wonder-Building-Kit-step-case-26-07.png) ![](./images/Wonder-Building-Kit-step-case-26-08.png) ![](./images/Wonder-Building-Kit-step-case-26-09.png) ![](./images/Wonder-Building-Kit-step-case-26-10.png) ![](./images/Wonder-Building-Kit-step-case-26-11.png) ![](./images/Wonder-Building-Kit-step-case-26-12.png) ![](./images/Wonder-Building-Kit-step-case-26-13.png) ![](./images/Wonder-Building-Kit-step-case-26-14.png) ![](./images/Wonder-Building-Kit-step-case-26-15.png) ![](./images/Wonder-Building-Kit-step-case-26-16.png) ![](./images/Wonder-Building-Kit-step-case-26-17.png) ![](./images/Wonder-Building-Kit-step-case-26-18.png) ![](./images/Wonder-Building-Kit-step-case-26-19.png) ![](./images/Wonder-Building-Kit-step-case-26-20.png) ![](./images/Wonder-Building-Kit-step-case-26-21.png) ![](./images/Wonder-Building-Kit-step-case-26-22.png) ![](./images/Wonder-Building-Kit-step-case-26-23.png) ![](./images/Wonder-Building-Kit-step-case-26-24.png) ![](./images/Wonder-Building-Kit-step-case-26-25.png) ![](./images/Wonder-Building-Kit-step-case-26-26.png) ![](./images/Wonder-Building-Kit-step-case-26-27.png) ![](./images/Wonder-Building-Kit-step-case-26-28.png) ![](./images/Wonder-Building-Kit-step-case-26-29.png) ## Hardware Connection Connect a [servo](https://www.elecfreaks.com/geekservo-2kg-360-degrees-compatible-with-lego.html) to S1 port on [Wukong breakout board](https://www.elecfreaks.com/wukong-board-with-lego-holder-for-micro-bit.html). ![](./images/Wonder-Building-Kit-case-26-06.png) ## Software Platform --- [MakeCode](https://makecode.microbit.org/) ## 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) ### Program ![](./images/Wonder-Building-Kit-case-26-04.png) Link:[https://makecode.microbit.org/_VrPehd4athgo](https://makecode.microbit.org/_VrPehd4athgo) ### Result When the micro:bit is powering on, it displays a heart icon. When button A is pressed, the corsair begins to swing; when button B is pressed for the second time, the swing amplitude increases, the third time press the A button amplitude and the swing goes to the maximum, the fourth time press the A button, swing amplitude has change; when the button B is pressed, the swing amplitude begins to decrease, when repeatedly pressed B button in three times, it stopped swinging.