yahboom
HomeTutorialsProduct
Solution
Blog
Online Store
About Us
EN/中文
Store
Building:bit Superkit📖
0.First Trial Video
  • First Trial Video
1.Assembly Course
  • 1.1Mobile shooter
  • 1.2Pretty car
  • 1.3Clip robot
  • 1.4Proficient carrier
  • 1.5Skip car
  • 1.6Freestyle
  • 1.7Spider
  • 1.8Lifting platform
  • 1.9Biped robot
  • 1.10Changing Face
  • 1.11Carousel
  • 1.12Oscillating fan
  • 1.13Airplane
  • 1.14Unicycle
  • 1.15Auto-door
  • 1.16Dragon knight
  • 1.17Ultrasonic handheld rangefinder
  • 1.18Small flying car obstacle avoidance
  • 1.19Changing face
  • 1.20Adjustable RGB light
  • 1.21Adjustable fan
  • 1.22Photosensitive emergency light
  • 1.23Smart alarm clock
  • 1.24Light-controlled bipedal robot
  • 1.25Swimming robot avoid objects
  • 1.26Fleeing spider
  • 1.27Temperature humidity reminder
  • 1.28Temperature-controlled fan
  • 1.29Color recognition machine
  • 1.30Color-recognizing automatic door
  • 1.31Rokcer color changing light
  • 1.32Rokcer transporter
2.Preparation before class
  • 2.1 About BBC microbit
  • 2.2 Super:bit expansion board
  • 2.3 MakeCode Graphical Programming Guide
  • 2.4 MakeCode graphical API
  • 2.5 Python Programming Guide
  • 2.6 Superbit MicroPython API
  • 2.7 Notes on charging and battery use
3.Basic modeling MakeCode course
0.Basic course
  • 1.Buzzer play music
  • 2.Control RGB color
  • 3.Control all RGB lights
  • 4.Drive 270°building block servo
  • 5.Drive 180° servo
  • 6.Drive motor
A.Mobile shooter
  • 1.Cannonball shooting
  • 2.Music fortress
  • 3.APP control
  • 4.Micro:bit handle control
  • 5.WiFi camera control
B.Pretty car
  • 1.Dancer
  • 2.APP control
  • 3.Micro:bit handle control
  • 4.WiFi camera control
C.Clip robot
  • 1.Dancing and singing
  • 2.Button control clip
  • 3.APP control
  • 4.Micro:bit handle control
  • 5.WiFi camera control
D.Proficient carrier
  • 1.Dancing
  • 2.Button control shovel
  • 3.Transportation
  • 4.APP control
  • 5.Micro:bit handle control
  • 6.WiFi camera control
E.Skip car
  • 1.Dance battle
  • 2.Button control skip car
  • 3.Powerful carrier
  • 4.APP control
  • 5.Micro:bit handle control
  • 6.WiFi camera control
F.Freestyle
  • 1.Dancing and singing
  • 2.Freestyle advance
  • 3.APP control
  • 4.Micro:bit handle control
G.Spider
  • 1.Spider advance
  • 2.The dancing spider
  • 3.APP control
  • 4.Micro:bit handle control
  • 5.WiFi camera control
H.Lifting platform
  • 1.Automatic Lift
  • 2.Button control platform
  • 3.APP control
  • 4.Micro:bit handle control
I.Biped robot
  • 1.Walking
  • 2.Dancing and singing
  • 3.APP control
  • 4.Micro:bit handle control
J.Changing Face
  • 1.Changing face
  • 2.Bite the hand crocodile
  • 3.APP control
  • 4.Micro:bit handle control
K.Carousel
  • 1.Music carousel
  • 2.APP control
  • 3.Micro:bit handle control
L.Oscillating fan
  • 1.Colorful windmill
  • 2.Summer cooling artifact
  • 3.APP control
  • 4.Micro:bit handle control
M.Airplane
  • 1.Sailing Prelude
  • 2.APP control
  • 3.Micro:bit handle control
N.Unicycle
  • 1.Clumsy reptile
  • 2.APP control
  • 3.Micro:bit handle control
O.Auto-door
  • 1.Soldiers on duty
  • 2.Music door
  • 3.APP control
  • 4.Micro:bit handle control
P.Dragon knight
  • 1.Waving wings
  • 2.APP control
  • 3.Microbit handle control
4.Basic modeling Python course
0.Basic course
  • 1.Buzzer play music
  • 2.Control RGB color
  • 3.Control all RGB lights
  • 4.Drive 270° building block servo
  • 5.Drive 180° servo
  • 6.Drive motor
  • 7.Drive stepper motor
A.Mobile shooter
  • 1.Cannonball shooting
  • 2.Music fortress
  • 3.Micro:bit handle control
B.Pretty car
  • 1.Dancer
  • 2.Micro:bit handle control
C.Clip robot
  • 1.Dancing and singing
  • 2.Button control clip
  • 3.Micro:bit handle control
D.Proficient carrier
  • 1.Dancing
  • 2.Button control shovel
  • 3.Transportation
  • 4.Micro:bit handle control
E.Skip car
  • 1.Dance battle
  • 2.Button control skip car
  • 3.Powerful carrier
  • 4.Microbit handle control
F.Freestyle
  • 1.Dancing and singing
  • 2.Freestyle advance
  • 3.Micro:bit handle control
G.Spider
  • 1.Spider advance
  • 2.The dancing spider
  • 3.Micro:bit handle control
H.Lifting platform
  • 1.Automatic Lift
  • 2.Button control platform
  • 3.Micro:bit handle control
I.Biped robot
  • 1.Walking
  • 2.Dancing and singing
  • 3.Micro:bit handle control
J.Changing Face
  • 1.Changing face
  • 2.Bite the hand crocodile
  • 3.Micro:bit handle control
K.Carousel
  • 1.Music carousel
  • 2.Micro:bit handle control
L.Oscillating fan
  • 1.Colorful windmill
  • 2.Summer cooling artifact
  • 3.Micro:bit handle control
M.Airplane
  • 1.Sailing Prelude
  • 2.Micro:bit handle control
N.Unicycle
  • 1.Clumsy reptile
  • 2.Micro:bit handle control
O.Auto-door
  • 1.Soldiers on duty
  • 2.Music door
  • 3.Microbit handle control
P.Dragon knight
  • 1.Waving wings
  • 2.Micro:bit handle control
5.Sensor Advanced MakeCode coursenew
1.Sensor principle
  • 1.1 About ultrasonic sensors
  • 1.2 Ultrasonic ranging
  • 1.3 About potentiometers
  • 1.4 Adjust potentiometer
  • 1.5 About photosensitive sensors
  • 1.6 Read the light intensity
  • 1.7 About infrared modules
  • 1.8 Obstacle detection
  • 1.9 Introduction of module
  • 1.10 Human body detection
  • 1.11 About temperature-humidity modules
  • 1.12 Read temperature humidity
  • 1.13 About color recognition sensors
  • 1.14 Color recognition
  • 1.15 About rocker module
  • 1.16 Control rocker
2.Sensor basic course
  • 2.1 Hand-held range finder
  • 2.2 Adjustable RGB light
  • 2.3 Emergency light
  • 2.4 Vibrating alarm clock
  • 2.5 Infrared detection broadcast
  • 2.6Human body infrared detection broadcast
  • 2.7 Temperature and humidity broadcaster
  • 2.8 Color recognition machine
  • 2.9 Rocker control light
3.Sensor expansion course
  • 3.1 Avoiding car
  • 3.2 Changing Face
  • 3.3 Adjustable fan
  • 3.4 Photosensitive robot
  • 3.5 Swimming robot
  • 3.6 Spiders sense human body
  • 3.7 Temperature control fan
  • 3.8 Automatic safety door
  • 3.9 Rocker carrier car
6.Sensor Advanced Python coursenew
1.Sensor principle
  • 1.1 About ultrasonic sensorsnew
  • 1.2 Ultrasonic rangingnew
  • 1.3 About potentiometersnew
  • 1.4 Adjust potentiometernew
  • 1.5 About photosensitive sensorsnew
  • 1.6 Read the light intensitynew
  • 1.7 About infrared modulesnew
  • 1.8 Obstacle detectionnew
  • 1.9 About human infrared sensing modulesnew
  • 1.10 Human body detectionnew
  • 1.11 About temperature-humidity modulesnew
  • 1.12 Read temperature humiditynew
  • 1.13 About color recognition sensorsnew
  • 1.14 Color recognitionnew
  • 1.15 About rocker modulenew
  • 1.16 Control rockernew
2.Sensor basic course
  • 2.1 Hand-held range findernew
  • 2.2 Adjustable RGB lightnew
  • 2.3 Emergency lightnew
  • 2.4 Vibrating alarm clocknew
  • 2.5 Infrared detection broadcastnew
  • 2.6 Human body infrared detection broadcastnew
  • 2.7 Temperature and humidity broadcasternew
  • 2.8 Color recognition machinenew
  • 2.9 Rocker control lightnew
3.Sensor expansion course
  • 3.1 Avoiding carnew
  • 3.2 Changing Facenew
  • 3.3 Adjustable fannew
  • 3.4 Photosensitive robotnew
  • 3.5 Swimming robotnew
  • 3.6 Spiders sense human bodynew
  • 3.7 Temperature control fannew
  • 3.8 Automatic safety doornew
  • 3.9 Rocker carriernew
Download
  • APP(iOS_Android)
  • Code_PythonLibrary
  • Hardware manual
  • Bluetooth communication protocol
  • Assembly Instructions Manual
  • Makecode offline software
Download ZIP

Welcome to Building:bit Superkit repository

2.6 Superbit MicroPython API

SuperKit Python library file API

SuperKit Python library file APIA. Superbit libraryB. Handle library ghandleC. Cube World

! Note: The SuperKit library adds drivers for the superbit expansion board and the Cube World to the official microbit-microPython library.

For other micro:bit APIs, please visit the official website of microbit-microPython: https://microbit-micropython.readthedocs.io/en/latest/

A. Superbit library

1) import superbit

Import superbit_micropython library

 

2) superbit.motor_control(a, b, 0)

Function: Control the motor interface on the expansion board to send PWM

Parameters:

a: Select the corresponding motor port (superbit.M1~superbit.M4)

b: PWM duty cycle (-255~255, positive value means forward rotation, negative value means reverse rotation)

For example: superbit.motor_control(superbit.M1, 255, 0)

 

3) superbit.motor_control_dual(a, b, c, d, 0)

Function: Control the two motors on the expansion board to send PWM at the same time

Parameters:

a: Select the corresponding first motor port 0 (superbit.M1~superbit.M4)

b: Select the corresponding second motor port (superbit.M1~superbit.M4)

c: The duty cycle of the PWM of the first motor port (-255~255, positive value means forward rotation, negative value means reverse rotation)

d: The duty cycle of the PWM of the second motor port (-255~255, positive value means forward rotation, negative value means reverse rotation)

For example: superbit.motor_control(superbit.M1, superbit.M3, 255, 255, 0)

 

4) superbit.servo270_V2(a, b)

Function: Control the servo interface on the expansion board to control the 270° servo

Parameters:

a: Select the servo port number (superbit.S1~superbit.S8)

b: Set the control angle (0-270)

For example: superbit.servo270_V2(superbit.S1, 120)

 

5) superbit.servo180(a, b)

Function: Control the servo interface on the expansion board to control the 180° servo

Parameters:

a: Select the servo port number (superbit.S1~superbit.S8)

b: Set the control angle (0-180)

For example: superbit.servo180(superbit.S1, 90)

 

6) superbit.stepper_control(a, b)

Function: Control the stepper motor on the expansion board

Parameters:

a: Select the servo port number (superbit.B1~superbit.B2)

b: Set the control angle (0~360)

For example: superbit.stepper_control(superbit.B1, 90)

 

 

B. Handle library ghandle

1) import ghandle

Import the handle library file

 

2) ghandle.B1_is_pressed()

Function: Press button B1 (red), return True when pressed, return False when released

 

3) ghandle.B2_is_pressed()

Function: Press button B2 (green), return True when pressed, return False when released

 

4) ghandle.B3_is_pressed()

Function: Press button B3 (blue), return True when pressed, return False when released

 

5) ghandle.B4_is_pressed()

Function: Press button B4 (yellow), return True if pressed, return False if released

 

6) ghandle.rocker(state)

Function: Detect the direction of the joystick, return True if it is consistent with the parameter, return False if it is inconsistent

Parameter: state: ghandle.up (up), ghandle.down (down), ghandle.left (left), ghandle.right (right), ghandle.pressed (pressed), ghandle.noState (no operation)

 

7) ghandle.get_value_x()

Function: Return the analog value of the joystick X channel, the value will change when moving left and right, increase to the left, and decrease to the right

 

8) ghandle.get_value_y()

Function: Return the analog value of the joystick Y channel, the value will change when moving up and down, decrease up, and increase down

 

 

C. Cube World

import WOM_Sensor_Kit

Import superbit_micropython library

 

1) RGB module

WOM_Sensor_Kit.WOM_rgb(1023,1023,1023)

Parameter definition: WOM_rgb(red, green, blue) Color range 0-1023, fixed connection P14, P13, P12 pins, cannot be changed.

 

2) Button module

WOM_Sensor_Kit.WOM_button(pin0)

Parameter definition: WOM_button(pin) Press to return 1, otherwise return 0

 

3) Rocker module

WOM_Sensor_Kit.WOM_rocker(pin0,pin1,WOM_Sensor_Kit.WOM_up)

WOM_Sensor_Kit.WOM_rocker(pin0,pin1,WOM_Sensor_Kit.WOM_down)

WOM_Sensor_Kit.WOM_rocker(pin0,pin1,WOM_Sensor_Kit.WOM_left)

WOM_Sensor_Kit.WOM_rocker(pin0,pin1,WOM_Sensor_Kit.WOM_right)

Parameter definition: WOM_rocker(pin X, pin Y, status), returns 1 or 0, X and Y can be modified to other pins, pay attention to keep the wiring consistent with the program.

 

4) Photosensitive module

WOM_Sensor_Kit.WOM_light(pin0)

Parameter definition: WOM_light(pin X) returns analog value 0-1023. The stronger the light, the smaller the value. X can be changed to other pins. Please make sure that the wiring is consistent with the program.

 

5) Infrared module

WOM_Sensor_Kit.WOM_ir(pin0)

Parameter definition: WOM_ir(pin X). If there is an obstacle, it returns 0. If there is no obstacle, it returns 1. X can be changed to other pins. Please make sure that the wiring is consistent with the program.

 

6) Temperature and humidity module

WOM_Sensor_Kit.WOM_dht11(pin0, WOM_Sensor_Kit.WOM_temp_C)

WOM_Sensor_Kit.WOM_dht11(pin0, WOM_Sensor_Kit.WOM_temp_F)

WOM_Sensor_Kit.WOM_dht11(pin0, WOM_Sensor_Kit.WOM_humidity)

Parameter definition: WOM_dht11(pin, read data), X can be changed to other pins, pay attention to keep the wiring consistent with the program.

Return the corresponding read data, including WOM_temp_C, WOM_temp_F, WOM_humidity

The interval between each acquisition must be more than 1s.

 

7) Ultrasonic module

WOM_Sensor_Kit.WOM_ultrasonic(pin3,pin2)

Parameter definition: WOM_ultrasonic(pin Echo, pin Trig), returns ultrasonic data. Echo and Trig can be changed to other pins, pay attention to keep the wiring consistent with the program.

 

8) Digital tube module

WOM_Sensor_Kit.WOM_init_display(1)

Parameter definition: WOM_init_display(brightness level) Range 0-7, where 0 is the largest, 1 is the smallest, 1-7 is increasing

WOM_Sensor_Kit.WOM_display(100)

Parameter definition: WOM_display(digital) Display digital range 0-9999, fixed connection SCL and SDA pins

 

9) Human infrared sensor module

WOM_Sensor_Kit.WOM_pir(pin0)

Parameter definition: WOM_pir(pin X) Someone returns 1, X can be modified to other pins, pay attention to keep the wiring consistent with the program.

 

10) Color recognition module

WOM_Sensor_Kit.WOM_color(WOM_Sensor_Kit.WOM_red)

WOM_Sensor_Kit.WOM_color(WOM_Sensor_Kit.WOM_green)

WOM_Sensor_Kit.WOM_color(WOM_Sensor_Kit.WOM_blue)

Parameter definition: WOM_color(acquired color), returns the read color RGB value, the returned value range is [0,255], fixed connection SCL and SDA pins

 

11) Servo

WOM_Sensor_Kit.WOM_servo360(pin10,360)

Parameter definition: WOM_servo360(pin X, angle), drives the servo connected to pin P10 to rotate to 360 degrees, X can be changed to other pins, pay attention to keep the wiring consistent with the program. The angle range is 0-360.

Python Programming Guide
Notes on charging and battery use

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/中文