Welcome to Building:bit Superkit repository
1.Colorful windmill
Colorful Windmill
Colorful Windmill1. Learning Objectives2. Building Blocks3. Motor Wiring4. Programming4.1 Adding extension packs4.2 Building blocks used4.3 Combining blocks5. Experimental phenomenon
1. Learning Objectives
In this course, we mainly learn how to use MakeCode graphical programming to make the oscillating fan rotate at different speeds, while the micro:bit dot matrix displays the dynamic picture of the windmill rotating, and the RGB light switches to different colors.
2. Building Blocks
For the steps of building blocks, please refer to the installation drawings of [Assembly Course]--[Oscillating fan] in the materials or the building block installation album.
3. Motor Wiring
The building block motor wiring is inserted into the M1 interface of the Super:bit expansion board, and the black wiring is inserted into the side close to the battery.
The building block servo wiring is inserted into the S1 interface of the Super:bit expansion board, and the orange servo wiring is inserted into the yellow pin of S1.
As shown below:
4. Programming
Method 1 Online Programming:
First, connect micro:bit to the computer via a USB data cable. The computer will pop up a U disk. Click the URL in the U disk: https://makecode.microbit.org/ to enter the programming interface. Then, add the Yahboom smart software package https://github.com/YahboomTechnology/SuperBitLibV2 to start programming.
Method 2 Offline Programming:
Open the offline programming software MakeCode and enter the programming interface. Click [New] and add the Yahboom software package https://github.com/YahboomTechnology/SuperBitLibV2 to start programming.
4.1 Adding extension packs
4.2 Building blocks used
The locations of the building blocks required for this programming are shown in the figure below.
4.3 Combining blocks
The summary program is shown in the figure below.
You can also directly open the microbit-Colorful-windmill.hex file provided in this experiment and drag it into the browser that opens the URL, and the program diagram of this project source code will be automatically opened
5. Experimental phenomenon
After the program is successfully downloaded, turn on the power switch, and a smiley face pattern will be displayed on the micro:bit dot matrix. Then the oscillating fan starts to rotate at different speeds, 50 speed for 1 second -> 100 speed for 1 second -> 150 speed for 1 second -> 200 speed for 1 second -> 255 speed for 2 seconds, and keep looping in this state. At the same time, we can see that the dynamic windmill rotation pattern will be displayed on the micro:bit dot matrix, and RGB will also switch different colors.
If you need to restart, please press the reset button on the back of the micro:bit motherboard.