You are on page 1of 14

Lesson 7–8

CHARLIE

Today we will build a robot named CHARLIE


and program it for a real music battle!

Let’s start with the assembly, of course.


Choose the appropriate robot from the main screen
(Figure 1).

2
Charlie

Figure 1

Charlie is built in four steps. Split up into teams and


complete these steps.
You can disregard the proposed code because we are only
interested in the assembly (Figure 2).

Figure 2

3
Lesson 7–8

The result should be this robot (Figure 3):

Figure 3

Next, load extra activities and build drums using the Drum
Solo instruction (Figure 4).
Now that the robot has a musical instrument, try to run the
code from the last activity.
Check out how it works (Figure 5).

4
Charlie

Figure 4

Figure 5

5
Lesson 7–8

You should also add a color sensor to the robot.


You need the following parts for this (Figure 6):

Figure 6

Let’s build the mounting base (Figures 7 and 8).

Figure 7

6
Charlie

Figure 8

Attach it to the robot’s head (Figure 9).

Figure 9

7
Lesson 7–8

Connect the color sensor to the C port (Figure 10).


And fix the wires on its back so that they do not interfere
(Figure 11).

Figure 10

Figure 11

8
Charlie

Let’s program the robot so that it plays different tunes


depending on the color captured by the color sensor.
You will act as a conductor who helps the robot to play
the concert.

Create a new project (Figure 12).

Figure 12

The first step after starting the program is to calibrate the


robot’s motors.

9
Lesson 7–8

You already know which block is responsible for this.


The main thing is not to confuse which robot you need to
calibrate (Figure 13).

Figure 13

Let’s specify motor for movement (Figure 14).

Figure 14

It is most likely that you have already seen how the


Charlie playing drums is implemented. There is a special
block for this: play drums for.
Place this block after the calibration.
The first value is responsible for the duration of playing
drums in seconds. The second one is responsible for the
number of hits per minute. Play around with the values to
see how this works (Figure 15).
10
Charlie

Figure 15

Now let’s bind this block to the color sensor event. Let
this rhythm play if the robot sees green (Figure 16).

Figure 16

Besides, you can bind some animations to color recogni-


tion (Figure 17).

Figure 17

11
Lesson 7–8

As well as sounds (Figure 18).

Figure 18

Or movements (Figure 19).

Figure 19

12
Charlie

Create different combinations of musical parts, move-


ments, and animations for different colors. Get creative
with this task and think beforehand about what the robot’s
concert should be.
Next, each team should have their robots perform. Use col-
ored parts to tell the robot what to play.

13
Lesson 7–8
Charlie

© STEP IT Academy
www.itstep.org

All rights to protected pictures, audio, and video belong to their authors or legal owners.
Fragments of works are used exclusively in illustration purposes to the extent justified by
the purpose as part of an educational process and for educational purposes in accordance
with Article 1273 Sec. 4 of the Civil Code of the Russian Federation and Articles 21 and 23
of the Law of Ukraine “On Copyright and Related Rights”. The extent and method of cited
works are in conformity with the standards, do not conflict with a normal exploitation of
the work, and do not prejudice the legitimate interests of the authors and rightholders.
Cited fragments of works can be replaced with alternative, non-protected analogs, and
as such correspond the criteria of fair use.
All rights reserved. Any reproduction, in whole or in part, is prohibited. Agreement of the
use of works and their fragments is carried out with the authors and other right owners.
Materials from this document can be used only with resource link.
Liability for unauthorized copying and commercial use of materials is defined according
to the current legislation of Ukraine.

You might also like