73. Case 69: The Trimpot Remote Control Car#

73.1. Introduction#

Use Nezha 48 IN 1 Inventor’s Kit with ELECFREAKS Interactive Coding Accessories Pack to make a remote control car through the potentiometer, which includes two blocks parts of the remote controller and the car.

../../_images/neza-inventor-s-kit-case-69-01.png

73.2. Case Building#

Materials Required#

ELECFREAKS micro:bit Nezha 48 IN 1 Inventor’s Kit

ELECFREAKS Interactive Coding Accessories Pack

Structure Building#

In this case we will make two block structures, the remote control car and remote control handle respectively.

Remote control car building steps

Parts list

../../_images/neza-inventor-s-kit-case-69-02.png

The structure is built as shown in the figure:

../../_images/neza-inventor-s-kit-step-69-01.png

../../_images/neza-inventor-s-kit-step-69-02.png

../../_images/neza-inventor-s-kit-step-69-03.png

../../_images/neza-inventor-s-kit-step-69-04.png

../../_images/neza-inventor-s-kit-step-69-05.png

../../_images/neza-inventor-s-kit-step-69-06.png

../../_images/neza-inventor-s-kit-step-69-07.png

../../_images/neza-inventor-s-kit-step-69-08.png

../../_images/neza-inventor-s-kit-step-69-09.png

../../_images/neza-inventor-s-kit-step-69-10.png

../../_images/neza-inventor-s-kit-step-69-11.png

../../_images/neza-inventor-s-kit-step-69-12.png

../../_images/neza-inventor-s-kit-step-69-13.png

../../_images/neza-inventor-s-kit-step-69-14.png

../../_images/neza-inventor-s-kit-step-69-15.png

../../_images/neza-inventor-s-kit-step-69-16.png

../../_images/neza-inventor-s-kit-step-69-17.png

../../_images/neza-inventor-s-kit-step-69-18.png

../../_images/neza-inventor-s-kit-step-69-19.png

../../_images/neza-inventor-s-kit-step-69-20.png

Build completion:

../../_images/neza-inventor-s-kit-step-69-21.png

Remote control handle building steps

Parts list

../../_images/neza-inventor-s-kit-case-69-03.png

The structure is built as shown in the figure:

../../_images/neza-inventor-s-kit-step-69-22.png

../../_images/neza-inventor-s-kit-step-69-23.png

../../_images/neza-inventor-s-kit-step-69-24.png

../../_images/neza-inventor-s-kit-step-69-25.png

../../_images/neza-inventor-s-kit-step-69-26.png

../../_images/neza-inventor-s-kit-step-69-27.png

../../_images/neza-inventor-s-kit-step-69-28.png

../../_images/neza-inventor-s-kit-step-69-29.png

../../_images/neza-inventor-s-kit-step-69-30.png

../../_images/neza-inventor-s-kit-step-69-31.png

../../_images/neza-inventor-s-kit-step-69-32.png

Finished Picture:

../../_images/neza-inventor-s-kit-step-69-33.png

Connection Diagram#

Remote control handle reference

Connect two Potentiometers to J1 and J2 port, and the Rainbowto J3 port on Nezha Breakout Board.

../../_images/neza-inventor-s-kit-case-69-04.png

Remote control car reference

Connect two Potentiometers to M1 port and M2 port on Nezha Breakout Board .

../../_images/neza-inventor-s-kit-case-69-05.png

73.3. MakeCode Programming#

Step1#

Click “extensions” in the MakeCode drawer.

../../_images/neza-inventor-s-kit-case-37-04.png

For programming the potentiometer and the rainbow,we need to add an extension library. Search with “PlanetX” in the dialog box to download this library.

../../_images/neza-inventor-s-kit-case-37-05.png

For programming the Nezha expansion board, we need to add an expansion library. Search with “Nezha” in the dialog box to download it.

../../_images/neza-inventor-s-kit-case-37-06.png

Notice: If you met a tip indicating that some codebases would be deleted due to incompatibility, you may continue as the tips say or create a new project in the menu.

Step 2#

*Remote control cart program

Write the program as the picture suggests#

../../_images/neza-inventor-s-kit-case-69-06.png

Reference#

Link: https://makecode.microbit.org/_4E0ayHcEHXgL

You may also download it directly:

Remote control handle program

Write the program as the picture suggests#

../../_images/neza-inventor-s-kit-case-69-07.png

Reference#

link: https://makecode.microbit.org/_51MbzXhRTDvq

You may also download it directly:

Result#

The two potentiometers can respectively remote control the left and right wheels of the cart, through the rainbow light ring on the handle shows the speed difference between the two wheels of the cart, when the speed of the right wheel of the cart is higher, the left side of the rainbow light ring on the handle lights up, then the cart turns left; when the speed of the left wheel of the cart is higher, the right side of the rainbow light ring on the handle lights up, then the cart turns right; when the speed of the wheels on both sides of the cart does not differ much, the three lights in the middle of the rainbow ring light up, and then the car moves forward.

../../_images/neza-inventor-s-kit-case-69.gif