yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
World of Module Sensor Kit📖
1.Introduction
  • 1.1 Introduction
  • 1.2 Building block list
2.Programming preparation
  • 2.1 About BBC microbit
  • 2.2 About Microbit expansion board
  • 2.3 MakeCode Programming Guide
  • 2.4 Programming block reference manual
  • 2.5 Python Programming Guide
  • 2.6 Python API
3.Basic course(MakeCode)
RGB light module
  • 1.Introduction of module
  • 2.Light up a RGB
Button module
  • 1.Introduction of module
  • 2.Button detection
Rocker module
  • 1.Introduction of module
  • 2.Control rocker
Photosensitive module
  • 1.Introduction of module
  • 2. Read the light intensity
Infrared module
  • 1.Introduction of module
  • 2. Obstacle detection
TemperatureHumidity module
  • 1.Introduction of module
  • 2.Read temperature humidity
Ultrasonic module
  • 1.Introduction of module
  • 2. Ultrasonic ranging
Digital Tube module
  • 1.Introduction of module
  • 2. Digital tube display
Human body infrared module
  • 1.Introduction of module
  • 2.Human body detection
Color Recognition module
  • 1.Introduction of module
  • 2. Color recognition
Servo
  • 1.Introduction of servo
  • 2.Drive servo
4.Advanced course(MakeCode)
  • 4.1 Table lamp
  • 4.2 Rocker control light
  • 4.3 Emergency light
  • 4.4 Infrared warning device
  • 4.5 Hand-held rangefinder
  • 4.6 Human body warning device
  • 4.7 Color recognition
  • 4.8 Thermometer
  • 4.9 Smart wiper
  • 4.10 Rotating rangefinder
  • 4.12 Piggy bank
5.Creative cours(MakeCode)
  • 5.1 Running box
  • 5.2 Temperature-humidity measurement
  • 5.3 Lifting platform
  • 5.4 Interactive box
  • 5.5 Moving basket
  • 5.6 Automatic door
  • 5.7 Sunflower
  • 5.8 Flying penguin
  • 5.9 UFO catcher
  • 5.10 Color sorter
6.Basic course(Python)
  • 6.1 Light up a RGB
  • 6.2 Button detection
  • 6.3 Control rocker
  • 6.4 Read the light intensity
  • 6.5 Obstacle detection
  • 6.6 Read temperature humidity
  • 6.7 Ultrasonic ranging
  • 6.8 Digital tube display
  • 6.9 Human body detection
  • 6.10 Color recognition
  • 6.11 Drive servo
7.Advanced course(Python)
  • 7.1 Table lamp
  • 7.2 Rocker control light
  • 7.3 Emergency light
  • 7.4 Infrared warning device
  • 7.5 Hand-held rangefinder
  • 7.6 Human body warning device
  • 7.7 Color recognition
  • 7.8 Thermometer
  • 7.9 Smart wiper
  • 7.10 Rotating rangefinder
  • 7.11 Piggy bank
8.Creative course(Python)
  • 8.1 Running box
  • 8.2 Temperature-humidity measurement
  • 8.3 Lifting platform
  • 8.4 Interactive box
  • 8.5 Moving basket
  • 8.6 Automatic door
  • 8.7 Sunflower
  • 8.8 Flying penguin
  • 8.9 UFO catcher
  • 8.10 Color sorter
Download
  • Assembly Steps
  • Code
  • MicroPython_library
Download ZIP

Welcome to World of Module Sensor Kit repository

2.4 Programming block reference manual


We need to add the building block software extension package of this kit, the package URL: https://github.com/YahboomTechnology/Module-World

The content of this introduction is mainly divided into digital category, analog category, PWM category, color recognition, digital tube, the color of different types of blocks is different.

Users can quickly locate and find by the color of the building blocks.

image.png 

1. Digital category programming building blocks

image.png  

1.1 Temperature Humidity module

image.png 

Connect the temperature and humidity module to the P0P1 pin of Micro:bit and get the current temperature. You can click temperature(℃) to switch to get Fahrenheit temperature or humidity, or click P0P1 to switch to connect to other pins.

image.png 

Eg: Connect the temperature and humidity module to the P0P1 interface of the micro:bit expansion board, and the LED of the Micro:bit motherboard will display the current ambient temperature in cycles.

image.png  

1.2 Ultrasonic module

image.png 

Connect the ultrasonic module to the P0P1 pin and get the current ultrasonic distance. You can click P0P1 to switch to connect to other pins.

image.png 

Eg: Connect the ultrasonic module to the P0P1 interface of the micro:bit expansion board, and micro:bit LED dot matrix will display the obstacle distance in a loop.

image.png 

1.3 Human body infrared module

image.png 

Connect the human infrared module to the P0P1 pin and return to the detected infrared state of the human body.

There are two states that can be selected, no one is moving and one is moving. You can click NoPIR to switch status. You can click P0P1 to choose pins.

image.png 

Eg1: Connect the human infrared module to the P0P1 pin. If a person is detected, the number 1 will be displayed, and if it is detected that no one is moving, the number 0 will be displayed.

image.png 

1.4 Infrared module

Connect the infrared module to the P0P1 pin and return to the detected infrared state of the obstacle.

There are two states that can be selected, there are obstacles and no obstacles. You can click obstacle to switch status. You can click P0P1 to choose pins.

image.png 

Eg: Connect the infrared module to the P0P1 pin. If an obstacle is detected, the number 1 will be displayed, and if an obstacle is detected, the number 0 will be displayed.

image.png  

1.4 Button module

image.png 

Connect the button module to the P0P1 pin and return to the installed state of detection. There are two states to choose from: press and release. You can click Press to enter the selection interface, and select release to switch to status.

image.png  

Eg: Connect the button module to the P0P1 pin, if the button is detected to be pressed, the number 1 is displayed, otherwise the number 0 is displayed.

image.png 

2. Analog category programming building blocks

image.png  

2.1 Photosensitive module

image.png 

Connect the photosensitive module to the P0P1 pin and return the detected light intensity value. The return value is 0-1024. The greater the light intensity, the greater the returned value.

image.png 

Eg: Connect the photosensitive module to the P0P1 pin, and the dot matrix displays the current light intensity. The greater the light intensity, the greater the returned value.

image.png  

2.2 Rocker module

image.png 

Rocker module can be regarded as a potentiometer with two channels, which can output the X-axis and Y-axis analog values. The X and Y values of the initial output are 512. Because of the difference between each rocker, the initialization value may be a little different. The value of the rocker module will increases from the left to the right of the X axis, and the value of the rocker module will decreases from the down to the up of the Y axis. X axis and Y axis output analog value range: 0 ~ 1023.

Near the terminal port is the down direction of the Y direction. Using this as a standard to distinguish the X direction and the Y direction. For example, when the X-axis direction moves to the left, the output X value will become smaller; when the X-axis direction moves to the right, the output X value will become larger. When the Y-axis direction moves to the up, the output Y value will become larger; when the Y-axis direction moves to the down, the output Y value will become smaller.

Connect the joystick module to the P0P1 pin and return to the detected installation state. There are five states available for selection: NoState, Up, Down, Left, and Right. You can click NoState to enter the selection interface and switch to other options.

image.png 

Eg: Connect the rocker module to the P0P1 pin, if you move the joystick upwards, the dot matrix will display an upward arrow;

if you move the joystick upwards, the displayed arrow will go down;

if you move the joystick to the left The displayed arrow is to the left;

if you move the joystick to the right, the displayed arrow is to the right.

image.png 

3. PWM category

image.png  

3.1 Servo

image.png 

Connect the 360°servo to the P1 pin and drive the servo to the 0° position.

image.png 

Eg: Connect the 360° servo to pin P1, servo will rotate to the 0° position, and start to rotate counterclockwise. It rotates 90° at an interval of 1 second.

When it reaches 360°, it starts to rotate clockwise. It rotates 90° at an interval of 1 second, until servo rotate 0°. And keep the loop like this status.

image.png 

3.2 Color recognition sensor

image.png 

Before using Color recognition sensor, we need to add the extension package of this kit, the package URL:

https://github.com/YahboomTechnology/module_world_color

image.png 

The programming block indicates the value of the color recognition sensor. There are three return values: R value, G value, and B value.

You can click the small triangle above R value to enter the selection interface and switch to other options.

image.png  

Eg: Connect the color recognition module to the IIC interface (VCC, SCL, SDA, GND), and display the current R, G, B values read by the color sensor.

image.png 

3.3 Digital Tube module

image.png 

Before using Digital Tube module, we need to add the extension package of this kit, the package URL:

https://github.com/YahboomTechnology/tm1650

image.png  

We can choose to display characters and numbers.

Eg: Connect the digital tube to the IIC interface (VCC, SCL, SDA, GND) and display the number 1234.

image.png

MakeCode Programming Guide
Python Programming Guide

COMPANY

  • About us
  • Team Style
  • Blog

LEARNING & EXPLORATION

  • Tutorials
  • Edge AI hardware
  • Educational robots
  • Embedded intelligent hardware

WHERE TO BUY

  • Yahboom Online Store
  • Amazon
  • Alibaba
  • AliExpress
  • Mercado

TECHNOLOGY SUPPORT

  • Email: support@yahboom.com

BE A DISTRIBUTOR

  • Email: sales@yahboom.com
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文