Course Content
About BBC microbit
Micro:bit board is designed by BBC which aims to help children at or above 7 grade to learn programming better. Micro:bit board has abundant board resources, including a 5*5 LED metric dot array, 2 programmable buttons, Compass, USB ports, Bluetooth module etc.. It is only pocket size but very powerful. You can programming, customize or control it as well. The latest Micro:bit V2 board comes with a touchable Logo and microphone on the front. A speaker is added on the back, so all kinds of sounds can be played without external equipment. The gold finger at the bottom adds a gear design to facilitate the user to better fix the alligator clip. In addition, the 2nd generation Micro:bit board also support sleep mode. Users can make it enter sleep mode by long pressing the reset button, which can reduce power consumption. The most important feature is that the CPU performance of the Micro:bit V2 board is much better than the V1 version, coupled with more RAM. So Micro:bit V2 allow users to expand more functions and create more creative works.
0/1
Transfer code to the micro:bit
This guide explains how to transfer code from a computer or tablet so that it can run on a BBC micro:bit. It covers: Transferring a program from MakeCode or the micro:bit Python Editor from a computer from an Apple device (iPad or iPhone) from an Android device Transferring a program that has been downloaded as a file When your program is being transferred, your micro:bit will pause and you may see the yellow LED on the back flash. Once it’s copied across, your program starts running on your micro:bit.
0/6
BASIC LESSONS
Quick projects to suit all ages, searchable by computing topic, level, coding language and micro:bit feature
0/10
SENSOR LESSONS
Quick projects to suit all ages, searchable by computing topic, level, coding language and micro:bit feature
0/8
CREATOR BIT
The micro:bit Creator:bit Bricks Pack contains 360 degrees servos, the LED strips and almost 200 pieces bricks. Together with the well-designed assembly instructions and courses, it makes the kids learn the coding easily as well as how to build blocks in an interesting way. Let’s start building our kits with the tips!
0/9
Private: Welcome to Micro:bit starter kit
About Lesson

 

Purpose

To build a fan that is controlled by the temperature.

../../_images/Ringbit_Bricks_Pack_case_en_03_01.png

 Materials

../../_images/Ringbit_Bricks_Pack_case_en_03_02.png

 Background Knowledge

Bricks build-up

../../_images/Ringbit_Bricks_Pack_step_03_01.png

../../_images/Ringbit_Bricks_Pack_step_03_02.png

../../_images/Ringbit_Bricks_Pack_step_03_03.png

../../_images/Ringbit_Bricks_Pack_step_03_04.png

../../_images/Ringbit_Bricks_Pack_step_03_05.png

../../_images/Ringbit_Bricks_Pack_step_03_06.png

../../_images/Ringbit_Bricks_Pack_step_03_07.png

../../_images/Ringbit_Bricks_Pack_step_03_08.png

../../_images/Ringbit_Bricks_Pack_step_03_09.png

../../_images/Ringbit_Bricks_Pack_step_03_10.png

../../_images/Ringbit_Bricks_Pack_step_03_11.png

../../_images/Ringbit_Bricks_Pack_step_03_12.png

../../_images/Ringbit_Bricks_Pack_step_03_13.png

../../_images/Ringbit_Bricks_Pack_step_03_14.png

../../_images/Ringbit_Bricks_Pack_step_03_15.png

../../_images/Ringbit_Bricks_Pack_step_03_16.png

../../_images/Ringbit_Bricks_Pack_step_03_17.png

../../_images/Ringbit_Bricks_Pack_step_03_18.png

../../_images/Ringbit_Bricks_Pack_step_03_19.png

../../_images/Ringbit_Bricks_Pack_step_03_20.png

../../_images/Ringbit_Bricks_Pack_step_03_21.png

Software

MicroSoftmakecode

Programming

Step 1

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

../../_images/Ringbit_Bricks_Pack_case_en_03_03.png

In order to programme for the Ring:bit Bricks Pack, we need to add an extension. Click “Extensions” at the bottom of the drawer. Search “servo” in the dialogue box to download it.

../../_images/Ringbit_Bricks_Pack_case_en_03_04.png

Note: If you met a tip indicating codebase will be deleted due to incompatibility, you may continue as the tips tell or build a new project.

Step 2

Judge the returned value from the temperature sensor in “Forever” block, if the value is over 28 degrees, set the servos connected to P0 port turning; while less than 26 degrees, set the servos connected to P1 stopping turning.

../../_images/Ringbit_Bricks_Pack_case_en_03_05.png

Note: As the servo we used is in 360 degrees, the “servo” extension in MakeCode is suitable for servos in 180 degrees, therefore, setting the turning angle to 0 degree or 180 degrees will lead to the servo turning clockwisely or anti-clockwisely, and 90 degrees means to stop turning.

Code

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

You can also download it directly below:

Result

When the value is over 28 degrees, the fan turns; while less than 26 degrees, the fan stops turning.