Welcome to the DFRobot blog
:
www.dfrobot.com/blog-tag-microbit.html
35
/
86
Task 2: Set the fan running at different speed
Goal: In this task, we will learn how to use a knob module to control the speed of the fan. When a
larger analog input value the knob reaches, the faster speed the fan operates, vice versa. The
speed of the fan continuously changes when the knob rotates.
STEP 1: Connect the circuit as below. The button module used in task 1 should be replaced by a
knob module.
STEP 2: We will be using the fan module here again. To make the speed of the fan controlled by the
knob, we need to build a link between the speed and the input value of the knob. The knob is an
analog input module, which means it generates a signal ranging from 0 - 1023, by which controls
the speed of the fan. To read the signal, connect the knob module to P0, use the “analog read”
function under “Pins”.