Welcome to Building:bit Superkit repository
3.3 Adjustable fan
Adjustable fan
Adjustable fan1. Learning objectives2. Building blocks3. Sensor 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 adjust the fan angle through MakeCode graphical programming.
2. Building blocks
For detailed steps of building blocks, please refer to the installation drawings of [Assembly Course]--[Adjustable fan] in the materials or the building blocks installation brochure.
3. Sensor wiring
Insert the building block motor wiring into the M1 interface of the Super:bit expansion board, and the black wiring into the side close to the battery.
Insert the building block servo wiring into the S1 interface of the Super:bit expansion board, and the orange servo wiring into the yellow pin of S1.
The potentiometer is connected to the P0P3 pin.

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 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 Adjustable-fan.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 runs successfully, turn on the power switch, and a heart pattern will be displayed on the microbit dot matrix. The adjustable fan rotates at the maximum speed of 255. Turning the potentiometer can change the angle of the adjustable fan. At the same time, we can see that the microbit dot matrix will display a dynamic windmill rotating pattern.