メニュー
This article has been authorized by the original author for translation. The original author is: Oldřich Horáček. He is an avid hardware geek and maker and strives to make technology closer to people, promote startups and support interesting projects. He created the Bastírna HWKITCHEN website for this purpose and if you are in the Czech Republic you can find him at the HWKITCHEN electronics store.
Many years ago, when I was a child, I always liked remote control cars. Wireless cars are a great temptation for me, and this red Škoda 120LS is my childhood dream. I have to give a picture to illustrate.
Today we have many other options, but I'm sure similar cars are still very popular with kids. So in this article, I will teach you how to make a fun remote control car, and make it with building blocks and Micro:bit, so that we can learn a little bit while having fun.
The chassis of the car is made entirely of building blocks. If you often play with Lego or similar toys, it is likely that you have enough parts. But if you don't, then I recommend you use the ELECFREAKS micro:bit 32 IN 1 Wonder Building Kit to build this project.
Please see this picture for detailed building steps:
Of course, we also need a micro:bit board for control. It could be any V1.5, V2 or V2.2 version, they will all work fine.
Joystick:bit V2 and Retro Programming Arcade are both very suitable choices, which can not only ensure driving the car, but also allow you to control other things, and even create your own games on Retro Arcade. And the use of wireless control is very simple, just set a radio channel and start commanding.
For the Wukong module, you need to connect the motors to drive the wheels and the servos that perform the steering wheel duties. The motors are connected to M2 and S1. For the servo connections, pay attention to the polarity of the conductors.
To complete the steps of remote control, we need to write two programs for the Microbit.
The first program is for the joystick, where they will be recorded by button presses or joystick movements to send commands to the car.
The second program will monitor the radio channel in the car and drive the motors and engines according to the commands received.
In the program we start by setting up the radio group it must be the same as the car. Then in an endless loop we measure the movement of the joystick we try to press the button to move forward and backward at a certain speed. The program is simple and maybe only one command is worth noting which converts the analog value from the joystick (0-1023) to the servo rotation degrees. The joystick is in the middle of a given interval and tends to stay in that position. This means that if we don't touch the joystick the car will go straight.
https://makecode.microbit.org/_4P5e972W2he2
In a car, the procedure is even easier. The Microbit simply transmits the accepted values to the engine and servo drivers for appropriate action. These values are distinguished by name. "Angle" is used for wheel control, "Speed" is used for driving.
https://makecode.microbit.org/_8ytayt4akcK2
Now, we have created a simple but fun remote control car, enjoy it!