74. Case 70: Voice Controlled Laser Launching Vehicle#

74.1. Introduction#

Lasers have many applications in daily life, such as laser scalpels in medicine, cutting materials in industry, laser welding and laser drilling. In this lesson, we will experience the fascination of laser by using the laser module, let’s start!

../../_images/70_1.png

Materials Required#

Nezha expansion board × 1

micro:bit V2 × 1

Speech recognition module × 1

Laser module × 1

Four-Channel Tracking Sensor × 1

Motors × 2

RJ11 cables × 1

Bricks × n

Note: If you want all of the above components, you may purchase the Nezha 48 IN 1 Inventor’s Kit.

Assembly Steps#

Component Details

../../_images/70_2.png

Build it as the assembly steps suggest:

../../_images/70_3.png

../../_images/70_4.png

../../_images/70_5.png

../../_images/70_6.png

../../_images/70_7.png

../../_images/70_8.png

../../_images/70_9.png

../../_images/70_10.png

../../_images/70_11.png

../../_images/70_12.png

../../_images/70_13.png

../../_images/70_14.png

../../_images/70_15.png

../../_images/70_16.png

../../_images/70_17.png

../../_images/70_18.png

../../_images/70_19.png

../../_images/70_20.png

../../_images/70_21.png

../../_images/70_22.png

../../_images/70_23.png

../../_images/70_24.png

Completed picture:

../../_images/70_25.png

74.2. Connection Diagram#

We connect the four line following sensor and the speech recognition sensor to the IIC interfaces, the laser module to the J1 interface, and the connection diagram is as follows:

../../_images/70_26.png

74.3. MakeCode Programming#

Step 1#

Click “Advanced” in the MakeCode drawer to see more choices.

../../_images/49_10.png

We need to add a package for programming. Click “Extensions” at the bottom of the drawer and search with “nezha” to download it.

../../_images/49_11.png

We need to add a package for programming. Search with “PlanetX” in the dialogue box and click to download it.

../../_images/49_12.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.

Reference#

The program is displayed below:

../../_images/70_27.png

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

You may also download it directly:

Result#

When we say line following mode, the car will follow the black line on the map. When we say fire laser, the laser module will fire the laser. When we say stop firing, the laser module will stop firing the laser.

../../_images/70_28.gif