Picar-X Lesson 5 Guess Numbers

Basic Teaching Information

Suitable School Age

9-12 years old.


90 minutes




Teaching Objectives

1. Understand the technologies involved in the concept of voice interaction technology.

2. Learn about the concept, function and common application scenarios of TTS in daily life.

3. Learn to use conditional statements.

4. Get to know random numbers and variables

5. Master the usage of Bluetooth slider and button control.

6. Learn how to use WiFi, speech, conditional judgment, random number and variable blocks.

Important and Difficult Points of Teaching

Teaching Key Points

TTS technology,conditional judgment, random number.

Teaching Difficult Points

In conditional statement, the concepts of true and false are difficult to understand. The concept of variables is harder to understand.

Teaching Form

Give a lecture, cooperative group learning.

Teaching Media

Teaching Grouping and Teaching Aid

Teaching Group

Work in groups of one person.

Teaching Aid

PiCar (each student has one), tablet computer (each student has one), pen, and programming growth manual.

Teaching Procedure

Teaching Stage

Teaching Content


1. Lead in

Automatic drive isn't close enough to us yet.

But AI will upgrade the driving experience of cars before automatic drive technology is fully developed.

(A video: About the concept of intelligent automobile cab, the combination of intelligent driving assistance and intelligent mechanized functional control in car, including automobile entertainment, safe driving, automatic drive, intelligent navigation. )

As the driver's hands and eyes are occupied by tasks during driving, the on-board scenario has higher requirements on the speakerphone interaction function of voice. But artificial intelligence technology can help the driver realize the voice interaction with the car.

Speech interaction includes Automatic Speech Recognition (ASR), Natural Language Understanding (NLU), Dialogue Management (DM), Natural Language Generation (NLG) and TTS. Learn about the concept, function and common application scenarios of TTS in daily life.

15 minutes

2. Objective

Complete a number guessing game with PiCar. If the answer is wrong, PiCar will give voice prompts. If you answer correctly, PiCar will tell us the correct answer and start the next round of the game.

Here, the teacher can play with the students to guess the number and let students have a clear understanding of this game.

5 minutes

3. Program Test

Here, according to the real examples and the conditional judgment blocks in Ezblock, explain the use of judgment statement, the concept of the true or false of a condition, the use of button control and slider control, and the usage of the "talk" block.

Task 1: If button A is pressed, PiCar says: "Hello, friend." If button B is pressed, PiCar says: "Goodbye, friend."

WiFi and language configuration, as the initial configuration of program, are put into the start block. The functions in the task need executing constantly, so put the code in the forever block.

Task 2: Pick a random integer from 1-100, save it in a variable and print out.

1. Explain the concept of random number;

2. Random results need to be stored in variables. Explain how to use the variable module.

30-45 minutes

4. Read the program flow, complete tasks and optimize them.


Read the flow chart of the program, edit the final task program independently, and complete the task.

Guide the students to add various expansions according to their own ideas on the basis of completing the task (teachers can teach students according to their aptitude in this process, and the learning difficulty of students with better ability can be increased).

Task 3:Complete the program editing of the number guessing game, and play games with PiCar's intelligent voice assistant.
At the same time, in the process, children can be creative and make the game more enjoyable.

15-30 minutes

5. Summary and Reflection


1. What does speech interaction technology include?

2. What is TTS technology?

3. What is conditional judgment?

4. What is a random number? Why do we need variables in this lesson?


What did we ask PiCar to accomplish today? What difficulties did we encounter and what did we learn from this process?

10 minutes

6 Homework

Program to apply the TTS used in life to PiCar.


Leave a comment