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

1.Microbit car

Handle control car

1. Learning objectives

In this class, learn to use Python programming to read the wireless data transmission function of micro:bit, so as to realize the wireless remote control of the microbit handle bit car.

2. Introduction to wireless communication principle

Through the radio module of microbit, different devices can work together through a simple wireless network. When the radio function of microbit is turned on, a simple wireless LAN will be generated. The microbit motherboard with the radio function turned on can communicate by setting parameters within the effective range.

Wireless communication is divided into two program blocks: sending and receiving. Set the wireless group of the radio to the same group, and two microbit motherboards can communicate.

3.Code and analysis:

Car code

image.png 

First, import the libraries needed for this lesson from microbit: display is used for dot matrix display, Image calls the built-in image, and radio is for wireless communication function;

display.show(Image.HAPPY): Display a smile icon 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 set 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.

image.png 

image.png 

Note: The value of value needs to correspond to the value sent by the controller. Only the same value can receive and execute the command.

Handle control code:

Next, we will start to write the joystick control program. After writing, we need to download the program to the micro:bit mainboard of the controller.

image.png 

First, import the libraries display, sleep, Image, ghandle and radio that you need to use;

radio.on(): turn on the wireless function;

radio.config(group=1): set the wireless group = 1, which is consistent with the group of the car;

If the detection ghandle.rocker(ghandle.up) is True, it means that the joystick of the handle is pushed up, so that the wireless sends the “A” command and displays an upward icon;

If the detection ghandle.rocker(ghandle.down) is True, it means that the joystick of the handle is pushed down, so that the wireless sends the “B” command and displays a downward icon;

If the detection ghandle.rocker(ghandle.left) is True, it means that the joystick of the handle is pushed to the left, so that the wireless sends the “D” command and displays a left icon;

If the detection ghandle.rocker(ghandle.right) is True, it means that the joystick of the handle is pushed to the right, so that the wireless sends the “C” command and displays a right icon;

If the detection ghandle.rocker(ghandle. pressed) is True, it means that the joystick of the handle is pressed, so that the wireless sends the “0” command and displays the “NO” icon;

The remote control sends “0” and clears the display when there is no operation;

image.png 

Next, detect the buttons and send the “E”, “F”, “G”, and “I’ commands corresponding to B1 (red), B2 (green), B3 (blue), and B4 (turn off the light).

4. Download the program

After the program is written, connect the computer and the microbit mainboard with a microUSB data cable. Please click the Flash button to download the program to the micro:bit mainboard.

1. Open the Mu software and enter the code in the editing window. Note! All English and symbols should be entered in English. Use the Tab key for indentation. The last line ends with a blank program. 

2. Click the thumb 'Check' button to check if there are any errors in our code. If a cursor or underline appears on a line, it means a syntax error. Please check and modify it. If there is no error, the lower left corner will prompt that there is no problem with the detection.

image.png 

3.  Click the 'REPL' button to check whether the buildingbit library has been downloaded. If not, please refer to the tutorial of pre-class preparation -> importing the buildingbit library.

image.png 

4.  After the code is written, please click the 'Flash' button to download the program to the microbit mainboard.

image.png 

5. If the download fails, please make sure that the microbit is properly connected to the computer via the microUSB data cable and that the buildingbit library has been downloaded. If the buildingbit library is not available, please refer to Pre-class Preparation -> Import buildingbit library.

5. Experimental phenomenon

After the bit car is powered on, the button on the right side of the remote control is the light-on button, and B4 is the light-off button. Pushing the joystick forward, backward, left, and right controls the car's forward, backward, left, and right movements.



Morning and night
Tinybit car

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