yahboom
HomeLearn
Solution
Blog
Online Store
About Us
EN/中文
Mini Microbit Handle📖
1.Preparation before class
  • 1.1 MakeCode Programming Guide
  • 1.3 How to import tiny:bit library
2.MakeCode programming course
A.General basic course
  • 3.Aircraft war
  • 4.Fruit game
  • 1.Heart beat
  • 2.See who is pressing fast
  • 3.Flowing sand
  • 4.DIY thermometer
  • 5.Direction follower
  • 6.Listen to music
  • 7.Dice game
  • 8.Good morning, good night
B.V2 basic course
  • 1.Play sound effects
  • 2.Changing face
  • 3.Clapping your hands
  • 4.Little mp3
  • 5.Temperature alarm
  • 6.Alarm clock
  • 7.Touch song
  • 8.Detect sound
  • 9.Sleep mode
C.Handle game course
  • 1.Direction-guide
  • 2.Dodge bullet game
  • 5.Jump
  • 6.Mini-racing
  • 7.Pingpong
  • 8.Snake
  • 9.Two machine battle
  • 10.Faster than who shakes
D.Remote control car course
  • 1.Mbit car
  • 2.Tinybit car
  • 3.Buildingbit
  • 4.Lastbit V2
E.Remote control building block kit course
  • 1.Tumblebit
  • 2.Bipedbit
  • 3.Spinbit
  • 4.Armbit
  • 5.Omnibit
  • 6.Spiderbit
  • 7.Pretty car handle control
  • 8.Clip robot handle control
  • 9.Proficient carrier handle control
  • 10.Skip car handle control
  • 11.Mobile shooter handle control
3.MicroPython programming course
A.Basic course
  • 1.Heart beat
  • 2.Button game
  • 3.Flowing sand
  • 4.DIY thermometer
  • 5.Direction follower
  • 6.Listen to music
  • 7.Dice game
  • 8.Morning and night
B.Remote control course
  • 1.Microbit car
  • 2.Tinybit car
  • 3.Buildingbit
  • 4.Lastbit
C.Remote control building block course
  • 1.Tumblebit
  • 2.Spinbit
  • 3.Armbit
  • 4.Omnibit
  • 5.Spiderbit
  • 6.Bipedbit
  • 7.Pretty car handle control
  • 8.Clip robot handle control
  • 9.Proficient carrier handle control
  • 10.Skip car handle control
  • 11.Mobile shooter handle control
Download
  • Code
  • Hardware Manual
Download ZIP

Welcome to Mini Microbit Handle repository

8.Clip robot handle control

3.Microbit handle control

Microbit handle control

Microbit handle control1. Learning objectives2. Building blocks3. Motor wiring4. Code Analysis4.1 Iron Armored Hand4.2 Handle5. Write and download the program6. Experimental phenomenon

1. Learning objectives

In this course, we mainly learn how to use Python programming to realize the remote control of the Iron Armored Saint with the micro:bit handle.

2. Building blocks

For the building blocks steps, please refer to the installation drawings of [Assembly course]-[Clip robot] in the materials or the building blocks installation album.

3. Motor wiring

The motor wiring on the left side of the car is inserted into the M1 interface of the Super:bit expansion board, and the black wire is close to the battery side;

The motor wiring on the right side of the car is inserted into the M3 interface of the Super:bit expansion board, and the black wire is close to the battery side;

The building block servo wiring is inserted into the S1 interface of the Super:bit expansion board, and the orange servo wiring is inserted into the yellow pin of S1.

As shown in the figure below:

image-20250607163959305

! Notes:

When taking a course related to building block servos for the first time, we need to remove the gears on the servos and upload the program of this course to the micro:bit; then turn on the power switch of the Super:bit expansion board and wait for the building block servos to turn to the initial position; then, we can turn off the power, adjust the clamp to open to the widest point, and then install the servo gear. (If you have used the Iron Armored Hand and servo-related programs before, you can skip this step)

image-20250607094947210

4. Code Analysis

4.1 Iron Armored Hand

For the program, please refer to the Clip robot code.py file.

from microbit import *
import superbit
import radio
import neopixel

First, import the libraries needed for this lesson from microbit: the superbit library is dedicated to the superbit expansion board; neopixel is used to control RGB lights; radio is used for the wireless communication function of micro:bit.

​x
Red = (255, 0, 0)
Orange = (255, 165, 0)
Yellow = (255, 255, 0)
Green = (0, 255, 0)
Blue = (0, 0, 255)
Violet = (148, 0, 211)
White = (255, 255, 255)
color_lib = { 
'Red': Red, 'Orange': Orange, 'Yellow': Yellow, 'Green': Green, 
'Blue': Blue, 'Violet': Violet, 'White': White}
def RGBLight_more_show(first, num, color): 
global np 
​
np.clear() 
for i in range(first, first + num): 
np[i] = color_lib[color] np.show()

This section of the program is used to define different colors of RGB lights, and define the function RGBLight_more_show to control the color of the RGB light. This function will be called in the following main loop.

xxxxxxxxxx
np = neopixel.NeoPixel(pin12, 4)
display.show(Image.HEART)
radio.on()
radio.config(group=1)
superbit.servo270(superbit.S1, 0)

display.show(Image.HAPPY): Display a smiley face pattern on the microbit dot matrix;

np = neopixel.NeoPixel(pin12, 4): Initialize the RGB lights. There are 4 RGB lights in total, connected to the P12 pin of the microbit motherboard (check the hardware interface manual);

radio.on(): Turn on the wireless function. Because the wireless function consumes more power and occupies more memory, it is turned off by default. You can also use radio.off() to turn off the wireless function;

radio.config(group=1): Configure wireless group=1, so that other microbit devices with wireless group=1 can communicate with each other. The default is 0, and the selectable group is 0~255. The set group value needs to be consistent with the handle setting, otherwise it will not communicate normally;

superbit.servo270(superbit.S1, 0): Initialize the servo to rotate to 0°.

xxxxxxxxxx
while True:
incoming = radio.receive()
if incoming == 'up':
superbit.motor_control(superbit.M1, 255, 0)
superbit.motor_control(superbit.M3, 255, 0)
...

In the main loop, determine whether the car receives the command sent by the handle, and control the movement state of the car and the color of the RGB light.

incoming = radio.receive(): Receive wireless data and save it to the incoming variable; if incoming is ‘up’, the Armored Saint moves forward, ‘down’ makes the Armored Saint move backward, ‘left’ makes the Armored Saint rotate left, ‘right’ makes the Armored Saint rotate right, and ‘stop’ makes the Armored Saint stop;

If incoming is ‘R’, the body RGB lights up red and the clamp is loosened, ‘G’ makes the body RGB light up green, ‘B’ makes the body RGB light up blue, and ‘Y’ makes the body RGB light up yellow and the clamp is clamped.

! Note:

The value of incoming needs to correspond to the value sent by the handle. Only the same value can receive and execute commands.

4.2 Handle

For details of the program, please refer to the Handle code.py file.

xxxxxxxxxx
from microbit import display, Image
import ghandle
import radio

First, import the libraries needed for this lesson from microbit: the ghandle library is dedicated to the micro:bit hand; radio is used for the wireless communication function of micro:bit.

xxxxxxxxxx
display.show(Image.HEART)
radio.on()
radio.config(group=1)

display.show(Image.HEART): Display a heart pattern on the microbit dot matrix;

radio.on(): Turn on the wireless function. Because the wireless function consumes more power and occupies more memory, it is turned off by default. You can also use radio.off() to turn off the wireless function;

radio.config(group=1): Configure wireless group=1, so that other microbit devices with wireless group=1 can communicate with each other. The default is 0, and the selectable group is 0~255. The set group value needs to be consistent with the handle setting, otherwise it will not communicate normally;

xxxxxxxxxx
Pretty car handle control
Proficient carrier handle control

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
QR Code

Copyright © 2017-2026 Yahboom. All Rights Reserved.

EN/中文