Sei sulla pagina 1di 174

Getting Started

Per entrare nell'ambiente di programmazione, fare clic su Apri progetto per aprire un
progetto esistente. possibile fare clic su Nuovo progetto per creare un nuovo
progetto.
FILE ORGANIZATION

Lobby
Project Tab
Add Project
Program Tab
Add Program
Project Properties
Files are organized into Projects.
For example, you may have built a dog robot. You create a Dog project, and within that project have
many programs, images, and sound files specifically for that robot. If you then built a Color Sorter, you
would create a Color Sorter project, with all the programs, images, and sound files relating to that robot.

PROGRAMMING CANVAS TOOLBAR

Show Opened Canvases List: The Opened Canvases List Drop-Down appears when you click
this tool. This lists all the Programs currently open within the Project.

Select: You need to be in this mode to edit your program. Click Select, then use your mouse to
select a single Programming Block to edit. Alternatively, drag a box around several
Programming Blocks to select them.
Pan
Comment
Save Project: Saving the project also saves all programs associated with the project.
Undo: Undoes the last action on the Programming Canvas.
Redo
Zoom Out
Zoom In
Zoom Reset
Open Content Editor
COMMENTS

I commenti sono utili per prendere appunti sul suo programma. Dopo aver posizionato
il vostro commento, trascinare e ridimensionare la casella Comments e scrivere un
commento.

Tips and Tricks


Comments are a great way to write down what you have been doing. Think of them as little reminder
notes to yourself.

Programs
You can create programs by dragging Programming Blocks (from the Programming Palettes, at the
bottom of the screen) onto the Programming Canvas.

Quando i blocchi di programmazione sono vicini l'uno all'altro, si uniscono


automaticamente.

When you run your program, the Programming Blocks will be run in the order that they appear in on the
screen, from left to right.

EDITING PROGRAMMING BLOCKS

Block Type: The icon indicates the Block Type


Block Handle: Click here to select or drag the block
Port Selector
Mode Selector: Click here to open the Mode Drop-Down, to select the mode
Input Parameter Values: Inputs can be selected or entered here
Sequence Plug Entry
Sequence Plug Exit
There is a detailed Help file for each Programming Block.

SEQUENCE WIRES
When Programming Blocks are not directly next to each other, you can connect them. Drag a Sequence
Wire from the first block to the second block.

You can remove a Sequence Wire by clicking the Sequence Plug Entry of the second block.

CODE CHUNKS
For long programs, it can be helpful to break the program into smaller chunks of Programming Blocks,
with spaces between the code chunks. This can make it easier to understand the program.
If you click the Sequence Plug Exit of a Programming Block, a space and a Sequence Wire are created.
To remove the space and the Sequence Wire, click the Sequence Plug Exit again.

Tips and Tricks


Make a separate chunk for each different thing your robot does, to make it easier to follow the program.

RESIZING FLOW PROGRAMMING BLOCKS


The Loop and Switch blocks can be resized. You can make them bigger so that other Programming Blocks
can fit neatly inside. Resize these Programming Blocks by dragging the Resize Handles.

For a Switch, each condition can be resized independently.

PARALLEL SEQUENCES
You can run more than one set of tasks simultaneously. For example, you might have one sequence of
Programming Blocks controlling the robots forward motion, and a second sequence of Programming
Blocks controlling the robotic arm on top of the robot.
You can create a parallel sequence by dragging a new Sequence Wire from the Sequence Plug Exit of the
Programming Block before the parallel sequence:

Tips and Tricks


Watch out for Resource Conflict (shown below)! Resource conflicts can happen when running
simultaneous tasks. For example, one sequence of Programming Blocks tries to steer the robot to the
left, and another sequence simultaneously tries to steer the robot to the right. The EV3 Brick will perform
unpredictably.

Project Properties
The Project Properties page gives an overview of your project and is used to manage the project files.

Project Properties
Project Title: This Title is shown in the Lobby
Project Description: Write a description of your project
Project Picture: Add a JPG or PNG image
Project Video: Add a video and a cover image
Daisy Chain Mode: Connect multiple EV3 Bricks together
Programs: List of project Programs
Images: List of project Images
Sounds: List of project Sounds
My Blocks: List of project My Blocks
Variables
Share Project: Click Share Project to go to the Mindstorms Website. Here you can share your
creation with the world.

MANAGING PROJECT FILES

If youve written a MyBlock for one project and want to use it in another project, select the MyBlock and
click Copy. Open the Project Properties page for the other project and click Paste to insert the MyBlock.
You can Copy and Paste Canvases, Images, and Sounds in the same way.
You can delete files by selecting them and clicking Delete.
Use the Import button to bring additional Canvases, Images, Sounds and MyBlocks into your project.

VARIABLES

Variables are managed from the Project Properties Page. Use the Copy and Paste button to move
Variables between Projects. Use the Delete button to delete variables and the Add button to add a new
Variable.
You can Read from a Variable and Write to a variable using the Variable block.

Project Properties
Quick links

Managing Project Files

Variables

Connecting to EV3
You need to establish a connection with your computer to get programs on your EV3 Brick.
There are three ways to make a connection:

USB Connection

Bluetooth Connection

Wi-Fi Connection

USB CONNECTION

1 Ensure your EV3 Brick is turned on.


.
2 Plug the USB cable, which came with your EV3 Brick, into the computer and the EV3 Brick.
.
3 The connection is established. Your EV3 Brick Display will show USB to confirm the
. connection.
BLUETOOTH CONNECTION

1 Ensure your EV3 Brick is turned on.


.
2 Ensure that Bluetooth is enabled on your EV3 Brick.
.
3 Click Expand/Collapse Hardware Page in the EV3 Software to expand the Hardware Page.
.
4 Select the Available Bricks tab. If your EV3 Brick is not on the list, check the BT box and click
. Refresh to locate the device.
5 Accept the connection on your EV3 Brick by manually entering the passkey. The default is 1234.
.
6 The connection is established. A Bluetooth icon will be shown on the EV3 Brick Display to
. confirm the connection.

WI-FI CONNECTION

1 Ensure your EV3 Brick is turned on.


.
2 Ensure that Wi-Fi is enabled on your EV3 Brick.
.
3 Plug the USB cable, which came with your EV3 Brick, into the computer and the EV3 Brick.
.
4 Access the Wireless Setup tool on the Hardware Page in the EV3 Software (shown below), or
. open it up from the Tools Menu.

5 Select the network you want to connect to and click Connect to configure the connection.
. - Click Add to add a network that is not broadcasting its SSID.
- Click Edit to edit the settings of a previously configured network.
6 Select the network you want to connect to and click Connect to configure the connection.
. - Click Add to add a network that is not broadcasting its SSID.
- Click Edit to edit the settings of a previously configured network.
7 Click OK to establish a Wi-Fi connection.
.
A Wi-Fi icon will be shown on your EV3 Brick Display to confirm the connection.
Tips and Tricks
When a successful connection is made to an EV3 Brick, the EV3 icon on the Hardware Page will turn from
grey to red.

CHECKING AND CHANGING THE CONNECTION TYPE


Click Expand/Collapse Hardware Page in the EV3 Software to expand the Hardware Page. Here you can
see the current connection type to your EV3 Brick.

AVAILABLE BRICKS
The Available Bricks tab shows all EV3 Bricks currently available for connection. Click Refresh to update
the list of available EV3 Bricks. You can change the connection type by selecting the appropriate check
box. However, the new connection will only work if your EV3 Brick has been set up correctly, and is either
connected by a USB cable, or in range for a Wi-Fi or Bluetooth connection.

Available Bricks tab


Refresh
Filter Connection Type
Connected
Disconnect

Hardware Page
The Hardware Page provides information about your EV3 Brick. It can be viewed by clicking the Expand/
Collapse tab.

Expand/ Collapse
DOWNLOADING A PROGRAM PROGRAMMING MODE
When your program is ready, you can download it to your EV3 Brick.
Ensure that the EV3 Brick is switched on and connected to the computer. The connection can be via a
USB Cable, Bluetooth, or Wi-Fi. See Connecting to your EV3 Brick.
You can download your program to the EV3 Brick by clicking the green triangle of the Start Block.
Alternatively, click the appropriate button on the Hardware Page Controller:

Download: download the program to the EV3 Brick


Download and Run: download the program to the EV3 Brick and run it immediately
Run Selected: download only the highlighted blocks to the EV3 Brick and run them

immediately
DOWNLOADING AN EXPERIMENT - EDUCATION EDITION ONLY

Download: download the Experiment to your EV3 Brick


Download and Run: download the Experiment to your EV3 Brick and start it running
immediately
Upload: Upload your collected datasets to the Dataset Table
BRICK INFORMATION

The Brick Information tab displays important information about the EV3 Brick that is currently connected.

Brick Information tab.


Brick Name: The name of your EV3 Brick.
Battery Level: Indicates how much power is left in your battery.
Firmware Version: The current version of firmware your EV3 is running.
Connection Type: The current connection between your computer and EV3 Brick.
Wireless Setup: Opens the Wireless Setup Tool to set up a wireless connection between your
software and the EV3 Brick.
Memory Bar: The amount of memory being used on your EV3 Brick.

Memory Browser: Opens up the Memory Browser for file management.


PORT VIEW
The Port View tab displays information about the sensors and motors connected to the EV3 Brick. When
your EV3 Brick is connected to the computer, these are automatically identified.

Port View tab


Tips and Tricks
Try it: With a Large Motor connected to a Port, turn the wheel and watch the live values change. Connect
a Sensor too and see what happens!

Se il vostro EV3 Brick non pronto per la connessione, ancora possibile impostare la
scheda Port View manualmente. Selezionare una porta, quindi selezionare l'hardware
appropriato dall'elenco.

When the hardware on the ports has been identified or set up, the Programming Blocks will use those
Port Values by default. For example, you might have a Touch Sensor on Port 4. After the EV3 Software
identifies the Touch Sensor, the Port Selector will always be set to Port 4 for a Touch Sensor.
What happens if you change your robot? Lets say youve decided to change one of your motors from Port
A to Port C. If the Port Selector on the Programming Block does not match the Port View tab, then the
EV3 Software uses a warning sign to indicate that corrections are needed.

AVAILABLE BRICKS

La scheda The Available Bricks mostra gli EV3 attualmente disponibili per la connessione.
Ulteriori informazioni sul collegamento a questi EV3 pu essere trovato in Connecting

to your EV3 Brick.


Available Bricks tab

NXT COMPATIBLE HARDWARE


The following NXT hardware is compatible with the EV3 Brick:

Touch Sensor
Sound Sensor
Ultrasonic Sensor
Light Sensor

Port Selection
PORT SELECTOR

Molti blocchi di programmazione richiedono di selezionare le porte sul EV3 Brick (A, B,
C, D, 1, 2, 3, e 4) che useranno. I selettori delle porte sono nell'angolo in alto a destra.
MOTOR PORTS
This image shows the Port Selectors on all of the motor blocks. The Move Steering and Move Tank blocks
are similar.

Click the Port Selector to display the port list and select a port. Motors must be connected to ports A, B,
C, or D on the EV3 Brick.
Since the Move Steering and Move Tank blocks control two different motors, these have two Port
Selectors. The first Port Selector is for the left motor, and the second is the right motor.

SENSOR PORTS
The image below show the Port Selectors on some of the blocks that use a sensor input.

Fare clic sul selettore porta per visualizzare l'elenco e selezionare una porta. I Sensori

devono collegare alle porte 1, 2, 3, o 4, tranne il sensore di rotazione del motore, che
deve connettersi alle porte A, B, C o D.
PORT ERRORS
Depending on which port you select, the Port Selector may display a Port Error, as shown below.

This is a warning that the motor or sensor connected to the selected port on the EV3 Brick does not
match the type required by the programming block. For example, if you select port 3 for a Touch
Sensor block, but the EV3 Brick detects no sensor connected to port 3, or a different type of sensor, a
Port Error will be displayed.

Tips and Tricks

1 The EV3 can only detect Port Errors when the EV3 Brick is connected to your computer (by
. USB, Bluetooth, or Wi-Fi).
2 You can use the Port View in the Hardware Page to easily see which motor and sensor types are
. connected to the different ports on your EV3 Brick when it is connected to your computer.
3 A program with a Port Error in it can still be downloaded and run on the EV3 Brick, but the
. performance of the affected blocks may be unpredictable.
DAISY-CHAINED BRICKS

possibile utilizzare daisy chain per collegare pi Bricks EV3 . Questo consente al
programma di controllare i motori ei sensori del collegati agli EV3 Brick. Ad esempio,
possibile utilizzare il collegamento a margherita per costruire un robot con due EV3,
fino a otto motori, e otto sensori, tutti controllati da un unico programma in
esecuzione su uno dei EV3.
If Daisy Chaining is enabled in your project (see Daisy Chaining), programming blocks with a Port
Selector will also include a Layer Selector control, as shown below.

Layer Selector
Port Selector

Select 1 from the Layer Selector to use a motor or sensor on the same EV3 Brick that the program is
running on. Select 2 to use a motor or sensor on the next EV3 brick in the chain, and so on.

WIRED PORT INPUT

If you select the Dynamic Port in the port list, a Port input will be added to the Inputs area of the
programming block. This allows you to specify the port using a Numeric Data Wire connected to the Port
input.

Port Selector
Dynamic Port
Port input
The Port input is Numeric, with the following values:

EV3 Port

Value of Port input

WIRED INPUT OF TWO PORTS

If you configure a Move Steering or Move Tank block for wired port input, you will need to specify two
different port numbers: one for the left motor port, and one for the right motor port. This is done by
using a two-digit number for the Port input. The first digit of the number (the 10s digit) specifies the port
number for the left motor, and the second digit (the 1s digit) specifies the port number for the right
motor.
See the table above for the individual motor port number values. The table below shows some examples
of Port inputs to specify two ports.

EV3 Motor Ports


(Left, Right)

Value of Port input

B, C

23

C, B

32

A, B

12

A, D

14

WIRED INPUT OF DAISY-CHAINED BRICKS


If Daisy Chaining is enabled, selecting the Dynamic Port from either the Layer Selector or the Port
Selector will add the Port input. The Port input allows you to specify both layer number and the port
value(s) with a Numeric Data Wire. This is done by using a three-digit number for the Port input, as
follows:

The 100s digit specifies the layer number of the EV3 Brick (100 for the current EV3 Brick, 200
for the next brick, and so on).
The 1s digit specifies the port number for a single motor or sensor.
For a Move Steering or Move Tank block, the 10s digit specifies the left motor port, and the 1s
digit specifies the right motor port.
Tips and Tricks
If you do not include a 100s digit, the port will reference the current EV3 brick, the same as if you had
added 100.
See the tables above for example values for single and multiple port values without Daisy Chaining. The
table below shows some example Port inputs that include Daisy Chaining.

Layer

Port(s)

Value of Port input

103 (or 3)

104 (or 4)

B, C

123 (or 23)

204

201

B, C

423

Data Wires
fornisce un valore di ingresso in un blocco di programmazione utilizzando un
valore di uscita da un altro blocco nel programma.. Questo crea interazioni tra blocchi
e comportamenti pi complessi per il vostro robot.
Il Data Wire

Example

Questo programma usa un Data Wire per collegare the Light output del blocco sensore colori
allingresso Power del blocco Move Steering . This will make the speed that the robot drives be
determined by the light intensity that the Color Sensor detects. The process is repeated in a Loop so that
the power is continuously updated based on new sensor readings.

Tips and Tricks


Se si prova il programma su di un robot con il sensore di colore rivolto verso il basso,
la velocit del robot varier con la variazione dei colori.
DATA WIRE TYPES
Data Wires carry values from one block to another. Each Data Wire has a type, which is determined by
the output type of the block at the start of the wire. This is also the type of the value carried by the Data
Wire. See Data Types for more information on the different types.
Data Wires, block inputs, and block outputs have a different appearance depending on their type, as
shown in the table below.

Type
Logic

Numeric

Text

Numeric Array

Block Input

Block Output

Block Output Data Wire

Logic Array
CREATING A DATA WIRE
To create a data wire, drag from an output of a programming block to an input of another programming
block, as shown in the steps below.

Step

Action

Start at a block output

Drag left to right

End at a block input

Example

Tips and Tricks

Il blocco con l'uscita (l'inizio del

Data Wire)

deve precedere il blocco con l'ingresso

(l'estremit del Data Wire) nel programma.

The block output and the block input must have the same Data Type, or be compatible for a Data
Wire Conversion.
sostituir il valore di ingresso che stato inserito direttamente nel blocco.
Nell'esempio precedente, il valore di ingresso power di 50 sostituito dal Data Wire. The
il Data Wire

Move Steering block is now getting the Power input from the Data Wire.

DELETING A DATA WIRE

To delete a data wire, click the block input at the end of the data wire. The Data Wire will be deleted, and
the input value that was entered directly into the block will be restored. Click the block input again to
enter a new input value.

USING A BLOCK OUTPUT FOR MULTIPLE DATA WIRES

You can use the output of a block as the starting point for more than one Data Wire, as shown in the
image below. To use an output again, simply drag another Data Wire.

Tips and Tricks

You cannot connect more input Data Wires to the same hub.

DATA WIRE CONVERSIONS


A Data Wire must connect a block output and a block input of the same type, or the types must be
compatible for one of the automatic conversions allowed below.

From Type

To Type

Result

Logic

Numeric

False = 0
True = 1

Logic

Text

False = 0
True = 1

Logic

Logic Array

Array with one element

Logic

Numeric Array

Array with one element (0 or 1)

Numeric

Text

Text representation of the number


(For example, 3.5)

Numeric

Numeric Array

Array with one element

Logic Array

Numeric Array

Array of same size with elements equal to 0 or 1

DISPLAYING DATA WIRE VALUES


If the EV3 brick is connected to your computer (by USB, Bluetooth, or Wi-Fi) when a program is running,
you can display the value of a Data Wire while the program is running. To display a Data Wire value,
simply position your mouse cursor over the Data Wire. The value will display in a small window near the
Data Wire.
Example

In the program below, the Data Wire has a value of 30 at the time the image was taken. In this example,
because the blocks are in a Loop, the value of the data wire can change each time the Color Sensor block
executes. The display updates continuously to show the most recent value.

Tips and Tricks


Visualizzare i valori Data Wire pu aiutare a capire come il programma sta funzionando.
valori diversi da quelli previsti possono aiutarti a trovare la causa di un problema nel
vostro programma. For example, if you create the program above but accidentally use the Measure
Color mode of the Color Sensor instead of the Measure Reflected Light Intensity mode, the Data Wire
will only show values in the range 0-7 instead of the range 0-100 as expected (see Using the Color
Sensor).

Ad esempio, se si crea il programma di cui sopra ma accidentalmente si utilizza Misura


- Modalit colore del sensore di colore al posto della misura - riflessa modalit di
intensit della luce, il Data Wire mostrera solo valori nell'intervallo 0-7 invece del range
0 - 100 come previsto (vedere Uso del sensore di colore).

Data Types
Data values in a program can have one of five different Types: Numeric, Logic, Text, Numeric Array, and
Logic Array. The Inputs and Outputs of Programming Blocks, Data Wires, Variables, and Constants all
have one of these types.

NUMERIC
The Numeric type represents a number. A Numeric value can be positive or negative, and it can have
digits after the decimal point.
Type
Numeric

Examples
3
1.25
-75
87456.3487
-0.002

LOGIC
The Logic type represents a True or False value. The only two possible Logic values are True and False.
Type
Logic

Allowed Values
True
False

TEXT
The Text type represents a text string, which is a sequence of text characters, like a text message. A Text
value can be a word, a single letter, a sentence, or any sequence of characters in the Supported
Text character text.
Type
Text

Examples
Hello
A
This is a longer text
Aa123@#$%-+=

NUMERIC ARRAY

Il tipo Array rappresenta un elenco di numeri. La lista ha una certa lunghezza, e ogni
elemento nell'elenco un valore numerico. Un array pu avere qualsiasi numero di
elementi (limitato dalla memoria disponibile sul EV3 mattone). Gli elementi sono in un
ordine specifico, e ci possono essere duplicati.
For example, you could use a Numeric Array to specify the Set of Colors for the Color Sensor block in
Compare Color mode.

A Numeric Array displays as a list of numbers separated by semicolons (;). The entire list is enclosed in
square brackets ([ ]). Some examples are shown below.
Numeric Array

Length

[]

[3]

[2; 3; 5]

[0; -0.2; 845.25; 5; 5; 5]

Si pu creare un array, aggiungere elementi, accedere ai singoli elementi, e misurare


la lunghezza di un array usando blocco theArray Operations. inoltre possibile creare
un array con il Variable block.
LOGIC ARRAY
The Logic Array type represents a list of Logic values. This is similar to the Numeric Array type as
described above, except that each element in the array is a Logic value and can only have the values True
or False.

Content Editor
Il Content Editor usato per documentare il progetto. possibile creare pagine che contengono
descrizioni, foto, video e anche istruzioni di montaggio. Ogni pagina pu essere personalizzato con
diversi layout e pu eseguire automaticamente una serie di azioni, come l'apertura di programmi
specifici o evidenziare un blocco di programmazione particolare.
Open Content Editor to begin using it.

Selezionate Edit Mode per iniziare la modifica.


Chiudere Content Editor dopo aver terminato l'editing.
EDIT MODE
The Edit Mode allows you to view or edit your activity.

Page Title
Previous Page
Current Page Number
Total Page Count
Next Page

Page Area
Page Name: Used for linking between slides
Show Previous Page Button (only visible when multiple pages are used)
Show Next Page Button (only visible when multiple pages are used)
Page Action
Select Page Format
Page Thumbnails
Add Page
Delete Page
Move page up
Move page down
ADDING AND REMOVING PAGES
Click Add Page (+) to add a new page, then select a template.
Click Delete Page () to delete the selected page.

PAGE AREA

Personalizza ogni sezione del modello per mostrare uno o pi media types.

Media Type

Notes
See the Text section.

Text
Add an image (in PNG or JPG format).
Image
See the Building Instructions section.
Building
Instructions
Select a video file and a cover image.
Video
Add a sound file.
Sound
This could be Text, Video, Sound, or a Webcam Image for
Document

documenting your project.


Take a picture with your connected Webcam.
Webcam
Add and remove columns and rows as necessary.
Table
Each section within the Page Area has two additional options.

Wide Control: This setting allows the content to scroll horizontally if it is wider than the page.
User Editable: Enabling this option permits the section to be edited in View mode.
TEXT
The text you write can be customized with different font, size, color, and styles. You can also format your
text to perform actions when you click on them using images and create numbered/bullet lists.

TEXT ACTIONS
Click Add Action to insert custom actions. The action can be linked to Text, a Text Button, or an Image
Button. When the linked text, button, or image is clicked, one of the following actions is performed as
seen in this drop-down menu.

PAGE ACTION
When a Page is opened, it can automatically trigger an action. You can assign this action to a Page.

Nothing: Display the content

Go to Program: Opens a specified canvas

Open Multiple Programs

Go to Experiment

Open Website

SELECT PAGE FORMAT


Select Page Format is used to define the size of the page. Each page can have its own Page Format.

BUILDING INSTRUCTIONS
Building Instructions are used to insert multi-step building instructions into the Content Editor. The
building instructions must be created as individual JPG or PNG images before they are used in the
Content Editor.
Use the + and buttons to insert and remove images. Hover over the main image to reveal controls to
move steps left or right. Click the double arrows to move the image forward or backward in the
sequence.

Managing Files
Each Project you create in the EV3 Software is made up of a number of smaller files (images, sounds,
and so on). Stored within each Project file may be one or more programs, along with images, sounds,
text files, and/or raw data log files.

EV3 SOFTWARE FILE EXTENSIONS


The different files types used in the EV3 Software each have their own file extension.

File Type

File Extension

Programs
Data Logging Experiments

.ev3p (programs)
.ev3e (experiments)

Sound Files

.rsf

Graphics and Images

.rgf

Data Logs (Raw data)

.rdf

Project File (Encompasses all the above files.)

.ev3

Text File (Note that this is a plain text file.)

.rtf

Tips and Tricks


All files are stored within the Project file. If you want to access an individual file, use the Project
Properties Page to upload them to your computer.

APPLICATIONS

I progetti possono essere convertiti in applicazioni e trasferiti nella cartella Apps Brick
della EV3 Brick. Una volta convertiti, i blocchi di programmazione non possono pi
essere modificati. Le applicazioni possono essere eliminati tramite il Browser di
memoria. Selezionare Scarica come App dal menu Strumenti per convertire e scaricare
l'applicazione per il EV3 Brick.ON BRICK MEMORY
Each EV3 Brick has an available memory of about 16 Megabytes. Some of this memory is used to store
the example programs, graphics, and sound files that are pre-loaded on the EV3 Brick. This leaves about
6 Megabytes for the files you create and download.
If you want to free up more memory space, you can delete the example programs. See Memory
Browser for details on how to remove files.
Updating the EV3 Firmware will restore all files on the EV3 Brick to the factory default condition.
SD Storage Card
Extra storage space is available using the built-in SD Card Port.

The EV3 Brick accepts SD storage cards up to a maximum capacity of 32GB.

MANAGING AND TRANSFERRING FILES ON THE EV3 BRICK

It is sometimes necessary to manage files and memory on the EV3 Brick. You can do this using the
Memory Browser.
Detailed information about how to move, delete, and import files can be found in Memory Browser.

EV3 Keyboard Shortcuts


You can use keyboard shortcuts with the EV3 software.

Windows

Mac

Action

CTRL+A

Command-A

Select All

CTRL+B

Command-B

Stop EV3

CTRL+C

Command-C

Copy

CTRL+D

Command-D

Download to EV3

CTRL+H

Command-CTRLH

Show/Hide Context Help

CTRL+F

Command-F

Screenshot

CTRL+I

Command-I

EV3 Memory Browser

CTRL+M

Command-M

Show/Hide Hardware Page

CTRL+N

Command-N

New Program

CTRL+E

Command-E

New Experiment

CTRL+O

Command-O

Open...

CTRL+P

Command-P

Print

CTRL+Q

Command-Q

Quit

CTRL+R

Command-R

Download and Run

CTRL+S

Command-S

Save

CTRL+Shift+S

Command-Shift-S

Save Project As

CTRL+T

Command-T

Prediction

CTRL+U

Command-U

Upload from EV3

CTRL+V

Command-V

Paste

CTRL+W

Command-W

Close Tab

CTRL+Shift+
W

Command-ShiftW

Close Project

CTRL+X

Command-X

Cut

CTRL+Y

Command-Y

Redo

CTRL+Z

Command-Z

Undo

CTRL+G

Command-G

Switch tools

CTRL+Shift+
H

Command-ShiftH

Show/Hide Activity

CTRL+Shift+P

Command-Shift-P

Point Analysis

CTRL+Shift+
A

Command-ShiftA

Section Analysis

F1

CommandOption-?

Help

Action palette

Flow palette

Sensor palette

Data palette

Advanced palette

My Blocks palette

Left arrow

Left arrow

Move Block/Activity page left(depending on what is


selected)

Right arrow

Right arrow

Move Block/Activity page right (depending on what is


selected)

Alt+Drag

Alt-Drag

Pan diagram

CTRL+J

Command-J

New Comment

Supported Text
The EV3 Software supports English, Russian, Simplified Chinese and Japanese characters. These can be
used to name files, label loops, add comments, and so on.
The EV3 Brick Display only supports Simple Text.

SIMPLE TEXT

These are the Simple Text characters and symbols:

Simple Text is required for:

the Brick Name


displaying text on the EV3 Brick using the Display programming block
The EV3 Brick displays blanks when Simple Text fields contain characters other than Simple Text.
However, the characters will be shown correctly on the connected computer.

Daisy Chaining
Daisy Chaining allows you to connect EV3 Bricks together using EV3 USB Cables. You can then use the
first EV3 Brick in the chain to control the motors and read the sensors of the daisy chained EV3 Bricks.
Up to four EV3 Bricks can be daisy chained.
Select the Daisy Chaining check box on the Project Properties Page to enable Daisy Chaining.

DAISY CHAINING THE EV3 BRICKS


The USB Port on the side of the first EV3 is connected to the mini USB Port of the next EV3 Brick using an
appropriate USB cable. The PC Port of the next EV3 Brick in the chain is connected to the USB Port of the
previous EV3 Brick, using an appropriate USB cable.

USING THE LAYER SELECTOR


When Daisy Chaining is enabled, each Motor Block and Sensor Block is modified to include a Layer
Selector.

Use the Layer Selector to choose which EV3 Brick the programming block will run on.

EXAMPLES
The program below makes the Port B and Port C motors connected to the third EV3 Brick in the Daisy
Chain drive forward.

The program below drives the first EV3 robot and the second EV3 robot in the daisy chain forward at the

same time.

Printing
You can print Programming Canvases, Graphs or Project

Program or Experiment: This option gives access to the settings for printing a program or
experiment
(data logging features are only available in the Education version of the software).
Content: This option gives access to the settings for printing the content viewer contents.
PRINTING PROGRAM OR EXPERIMENT
Open the Program or Experiment you would like to print and select Print from the File Menu. You can also
use the shortcuts CTRL-P on Windows and Command-P on Mac.
The Print dialog box opens, as shown in the example below.

Entire View: This prints the entire program or experiment on a single page.
Visible Area: This will only print what can currently be seen on the screen.
If you have zoomed into a specific part, or panned across to a particular section, only this will
be printed.
Normal: Use the printers default page orientation.
Force Landscape: Force landscape orientation.
After you have selected the settings you want, click Print to start printing.

PRINTING CONTENT

All Pages: This prints all project or experiment content pages.


Pagina Corrente: stamper la pagina attiva corrente nel Content Viewer.

Specific Pages: This option allows you to print specific content pages in the project. Type page
numbers separated by commas and /or page rages separated by dashes in the Pages: option
that appears.
Building Instructions On: This enables printing of each building instruction step.
Building Instructions Off: This disables printing of each building instruction step.
The following options are only available for the LEGO MINDSTORMS Education software edition:

Student Pages Only: This prints only student pages.


Student and Teacher Pages: This prints both student and teacher pages.

Using the Infrared Sensor

Il sensore a infrarossi in grado di rilevare segnali infrarossi del telecomando (Beacon


IR). Il sensore a infrarossi pu anche inviare un proprio segnale, e rilevarne il riflesso
da altri oggetti.
Il sensore a infrarossi pu essere utilizzato in tre diverse modalit: prossimit, Beacon,
e remoti.
PROXIMITY MODE
In proximity mode, il sensore a infrarossi invia il proprio segnale ad infrarossi e ne rileva il

segnale riflesso da un oggetto di fronte al sensore. L'intensit del segnale riflesso pu essere
utilizzato per stimare la distanza dell'oggetto.
See Using the Infrared Sensor Proximity Mode.

BEACON MODE

In modalit Beacon(radiofaro), lIR trasmette continuamente un segnale speciale, e il


sensore a infrarossi in grado di rilevare la posizione approssimativa del faro di fronte
al sensore.
See Using the Infrared Sensor Beacon Mode.

REMOTE MODE

In modalit remota, il sensore a infrarossi in grado di rilevare la pressione dei


pulsanti sul IR Beacon. Ad esempio possibile utilizzare la modalit Remota per fare
un telecomando per il vostro robot,.
See Using the Infrared Sensor Remote Mode.

Tips and Tricks


La luce infrarossa lo stesso tipo di segnale usato dalla maggior parte dei
telecomandi TV. Non si pu vedere la luce a infrarossi, ma, come la luce visibile, viene
bloccato se gli oggetti sono in mezzo. Il Beacon IR deve avere una "linea di vista" al
sensore a infrarossi di essere visto. La luce solare pu anche interferire con i segnali
infrarossi, anche se normale luce ambiente non dovrebbe influire esso.

Using the Infrared Sensor Beacon


Mode

Infrared Sensor
Remote Infrared Beacon

In modalit Beacon, il sensore a infrarossi in grado di rilevare la posizione


approssimativa del telecomando (IR Beacon) davanti al sensore.. Il sensore pu fornire
la distanza del segnale e la sua denominazione (angolo dalla direzione del sensore di
punta). possibile utilizzare la modalit di Beacon, ad esempio, per far si che il vostro
robot possa cercare e guidare verso il IR Beacon.

TURN ON THE BEACON AND CHOOSE A CHANNEL

Accendere il faro premendo il pulsante Mode Beacon sulla parte superiore del
telecomando. L'indicatore LED si accende e rimanere acceso. Il faro rimane accesa e
trasmette continuamente fino a quando non si preme nuovamente il pulsante Mode
Beacon per spegnerlo.
Choose one of the four channels from the Channel Selector. The Infrared Sensor will only detect a beacon
on the channel that you specify in your program.

INFRARED SENSOR BEACON MODE DATA


In Beacon mode, the Infrared Sensor gives the following data:

Data

Type

Values

Notes

Detected

Logic

True/False

True if an IR Beacon is detected on the specified channel, otherwise False.

Proximit
y

Numeric

0 to 100

La distanza relativa dal trasmettitore. 0 significa molto vicino, e


100 significa lontano. La distanza sar 100 se il trasmettitore
non viene rilevato affatto.

Heading

Numeric

-25 to 25

0 means the beacon is directly in front of the sensor, negative values are to the
left, and positive values are to the right.

Tips and Tricks


The values for Proximity and Heading do not correspond directly to specific distances and angles. The
values will depend on the strength of the signal and other factors.
Example

This program will make a robot start driving when the IR Beacon is on and gets close enough to the
Infrared Sensor. It uses the Wait block in the Infrared Sensor Compare Beacon Proximity mode to
wait for the Proximity to be less than 20, then it drives forward for 2 seconds.
INFRARED SENSOR BEACON MODE BLOCKS AND MODES

La tabella mostra tutti i blocchi e le modalit possibili con la Infrared Sensor in Beacon
mode.
Block

Mode

Use

Wait

Infrared Sensor Compare


Beacon Heading

Wait for the beacon to be detected and for the Heading to reach a specified value.

Wait

Infrared Sensor Compare


Beacon Proximity

Wait for the beacon to be detected and for the Proximity to reach a specified value.

Wait

Infrared Sensor Change Beacon Heading

Wait for the beacon Heading to change by a specified amount.

Wait

Infrared Sensor Change Beacon Proximity

Wait for the beacon Proximity to change by a specified amount.

Loop

Infrared Sensor Beacon


Heading

Repeat a sequence of blocks until the beacon Heading reaches a specified value.

Loop

Infrared Sensor Beacon


Proximity

Ripete una sequenza di blocchi finch alla distanza del segnale


raggiunge un determinato valore.

Switch

Infrared Sensor Beacon


Heading

Scegli tra due sequenze di blocchi a seconda della direzione del


segnale .

Switch

Infrared Sensor Beacon


Proximity

Sceglie tra due sequenze di blocchi a seconda della distanza del


segnale

Infrared
Sensor

Measure - Beacon

Trasforma distanza e direzione in Numeric data wires, e lo stato rilevato in Logic data
wire.

Infrared
Sensor

Compare Beacon Heading

Compare the beacon Heading to a threshold, and get the result on a Logic data wire.

Infrared
Sensor

Compare Beacon Proximity

Compare the beacon Proximity to a threshold, and get the result on a Logic data wire.

Using the Infrared Sensor


Proximity Mode

In Proximity mode, the Infrared Sensor sends out an infrared signal, and it can detect the reflection of
this signal by an object in front of the sensor. The strength of the reflected signal can be used to estimate
the proximity of (distance to) the object. You could use the Proximity mode, for example, to detect when
your robot gets close to a wall.

INFRARED SENSOR PROXIMITY MODE DATA


In Proximity mode, the Infrared Sensor gives the following data:

Data

Proximit
y

Numeri
c
Numeric

Values

0 to
100

Notes

The relative distance to an object in front of the sensor. 0


means very close, and 100 means far away.

Tips and Tricks

Il valore di prossimit non corrisponde direttamente a una distanza specifica. Il

valore dipende dal colore e materiale dell'oggetto di fronte al sensore, e altri fattori.

Il sensore a infrarossi non pu rilevare la distanza di un oggetto troppo vicino


(distanza inferiore a circa 1 cm o mezzo pollice).
The Beacon mode of the Infrared Sensor also provides Proximity data, but only for detecting
proximity to the IR Beacon. See Using the Infrared Sensor Beacon Mode for more information.
EXAMPLES USING THE INFRARED SENSOR IN PROXIMITY MODE
Some examples of how you can use the Infrared Sensor in Proximity mode are below.
Example 1: Stop Driving Before Reaching a Wall

This program will make a robot drive forward until the Infrared Sensor detects that it is close to a wall or
other object. After the driving starts, the program uses the Wait block in the Infrared Sensor Compare
Proximity mode to wait for the Proximity to be less than 35 before stopping the robot.

Tips and Tricks


The distance that the robot stops before reaching an object will depend a lot on the color of the object.
This is because light colored objects reflect (infrared) light better than dark objects.

Tips and Tricks


Remember to use the On mode of the Move Steering block when you want to drive while waiting for a
sensor.
Example 2: Slow Down when Approaching a Wall

This program makes a robot gradually slow down as it approaches a wall or other object. It uses
the Infrared Sensor block in the Measure Proximity mode to get the Proximity on a Data Wire. This
value is used for the Power input of the Move Steering block, and the process is repeated in a Loop so
that the speed is continuously adjusted based on the Proximity.

INFRARED SENSOR PROXIMITY MODE BLOCKS AND MODES


La tabella mostra tutti i blocchi e le modalit possibili utilizzabili con il sensore a infrarossi in
Proximity mode.
Block

Mode

Use

Wait

Infrared Sensor Compare


Proximity

Attende finch la distanza raggiunge un valore


specificato.

Wait

Infrared Sensor Change Proximity

Wait for the Proximity to change by a specified amount.

Loop

Infrared Sensor Proximity

Ripete una sequenza di blocchi finch la distanza


raggiunge un determinato valore.

Switch

Infrared Sensor Beacon


Proximity

Choose between two sequences of blocks depending on the


Proximity.

Infrared
Sensor

Measure - Proximity

Get the Proximity value on a Numeric data wire.

Infrared
Sensor

Compare Proximity

Compare the Proximity to a threshold, and get the result on a


Logic data wire.

Using the Infrared Sensor Remote


Mode

Infrared Sensor
Remote Infrared Beacon

In modalit remota, il sensore a infrarossi in grado di rilevare quale tasto del


telecomando (Beacon IR) premuto. Si pu inoltre rilevare combinazioni di due tasti
premuti nello stesso momento. possibile utilizzare la modalit remote, per esempio,
per fare un telecomando per il vostro robot.
L'IR Beacon ha un selettore di canale che permette di scegliere uno dei quattro diversi
canali per i segnali. Il sensore a infrarossi rileva solo segnali dal canale specificato.
Tips and Tricks
Se due robot sono controllati da due differenti IR Beacons, dovrebbero usare canali
diversi. Altrimenti, un trasmettitore controller tutti i robot sul suo canale..
INFRARED SENSOR REMOTE MODE DATA
In Remote mode, the Infrared Sensor gives the following data:

Data

Button
ID

Type

Numeri
c

Rang
e
0 - 11

Notes

Identifies which button, or combination of buttons, is pressed


on the IR Beacon.

0 = No button (and Beacon Mode is off)


1 = Button 1
2 = Button 2
3 = Button 3
4 = Button 4
5 = Both Button 1 and Button 3
6 = Both Button 1 and Button 4
7 = Both Button 2 and Button 3
8 = Both Button 2 and Button 4
9 = Beacon Mode is on
10 = Both Button 1 and Button 2
11 = Both Button 3 and Button 4

Tips and Tricks


The Beacon Mode button (Button ID = 9) acts different than the other four buttons. When you press the
Beacon Mode button, the beacon starts transmitting continuously until you press the Beacon Mode button
again to turn it off. The other four buttons only transmit when they are held down and stop transmitting
when you release the button.

EXAMPLES USING THE INFRARED SENSOR IN REMOTE MODE


Some examples of how you can use the Infrared Sensor in Remote mode are below.
Example 1: Remote Start Button

Questo programma fa attendere il robot fino a quando si preme un pulsante sul IR


Beacon (utilizzando il canale 1), poi si spinge in avanti per 2 secondi. Esso utilizza il
blocco di attesa nel sensore a infrarossi - Change - modalit remota. Se si inizia con
premuto nessun tasto, questo attender fino a quando si preme un pulsante sul IR
Beacon.
Example 2: Remote Control Driving

The program below can drive a robot by remote control from the IR Beacon. It uses a Switch in Infrared
Sensor Measure Remote Buttons mode to choose from four different driving motions depending on
which button(s) on the IR Beacon are pressed. You can turn left and right by pressing the top left and top
right direction buttons, and go straight by pressing both of these buttons at the same time. The robot is
stopped when all buttons are released.

Il seguente programma pu guidare un robot utilizzando il telecomando. Esso utilizza


un interruttore a sensore a infrarossi - Misura - Remote Buttons mode per scegliere tra
quattro direzioni di guida a seconda di quale tasto viene premutoi sul Beacon IR.
possibile svoltare a sinistra e destra premendo il top tasti di direzione a destra in alto a
sinistra e, e proseguire premendo entrambi i pulsanti allo stesso tempo. Il robot si
arresta quando vengono rilasciati tutti i pulsanti.

INFRARED SENSOR REMOTE MODE BLOCKS AND MODES


The table below shows all of the programming blocks and modes that you can use with the Infrared
Sensor in Remote mode.

Block

Mode

Use

Wait

Infrared Sensor
Compare Remote

Attende la pressione di un pulsante specifico sulla


Beacon IR. You can also wait for one of a set of
specified buttons to be pressed.

Wait

Infrared Sensor
Change - Remote

Attende la pressione di untasto sul IR Beacon, o il


cambiamento di stato di un pulsante.

Loop

Infrared Sensor
Remote

Ripete una sequenza di blocchi finch viene premuto


un pulsante specificato sul IR (o se viene premuto
uno di una serie di pulsanti specificati).

Switch

Infrared Sensor
Measure Remote

Sceglie tra due o pi sequenze di blocchi a seconda


di quali tasti vengono premuti sulla IR Beacon.

Switch

Infrared Sensor
Compare Remote

Sceglie tra due sequenze di blocchi a seconda che si


preme un pulsante specificato sulla IR Beacon (o se
viene premuto uno di una serie di pulsanti
specificati).

Infrared
Sensor

Measure - Remote

Get the Button ID of the currently pressed button on the IR


Beacon on a Numeric data wire.

Infrared
Sensor

Compare Remote

Test if a specified button on the IR Beacon is pressed (or one


of a set of specified buttons), and get the result on a Logic
data wire.

Using the Ultrasonic Sensor


The Ultrasonic Sensor can measure the distance to an object in front of it. It
does this by sending out sound waves and measuring how long it takes the
sound to reflect back to the sensor. The sound frequency is too high for you to
hear (ultrasonic).
Si pu misurare la distanza da un oggetto in pollici o centimetri. ad
esempio, si pufar fermare il robot ad una certa distanza da una
parete.
inoltre possibile utilizzare il sensore ad ultrasuoni per rilevare la
presenza di un altro sensore nelle vicinanze. Ad esempio, si
potrebbe usare per rilevare la presenza di un altro robot che utilizza
un sensore ad ultrasuoni nelle vicinanze. In questa modalit "solo
ascolto", il sensore di ascolto per i segnali audio, ma non li invia.
ULTRASONIC SENSOR DATA
The Ultrasonic Sensor can give the following data:

Data

Type

Range

Notes

Distance in Centimeters

Numeric

0 to 255

Distance to object in centimeters.

Distance in Inches

Numeric

0 to 100

Distance to object in inches.

Ultrasound Detected

Logic

True/False

True if another ultrasonic sensor is detected.

Tips and Tricks

Il sensore ad ultrasuoni rileva meglio oggetti con superfici dure che riflettono meglio

il suono. Oggetti morbidi, come la stoffa, possono assorbire le onde sonore e non
essere rilevati. Gli oggetti con superfici arrotondate o angolari sono anche pi difficili
da rilevare.

The sensor cannot detect objects that are very close to the sensor (closer than about 3 cm or 1.5
inches).
The sensor has a wide field of view and may detect a closer object off to the side instead of a
farther object straight ahead.
EXAMPLES USING THE ULTRASONIC SENSOR
Some examples of how you can use the Ultrasonic Sensor in your program are shown below.
Example 1: Stop a Certain Distance before a Wall

This program makes a robot drive forward until the Ultrasonic Sensor detects something closer than 10
inches, then the robot is stopped. The program uses the Wait block in the Ultrasonic Sensor - Compare
Distance Inches mode to wait for the detected distance to become less than 10 inches. If the Ultrasonic
Sensor is facing forward, the robot will stop about 10 inches before a wall.

Tips and Tricks

Remember to use the On mode of the Move Steering block when you want to drive while waiting for a
sensor.
Example 2: Sound an Alarm when an Object is Detected Nearby

This program has the robot make a sound whenever the Ultrasonic Sensor detects an object closer than
50 centimeters away. The program uses a Switch with the Ultrasonic Sensor - Compare Distance
Centimeters mode to test whether the distance detected is less than 50 centimeters. If so, the Switch
plays a tone. The Switch is repeated in a loop so that the test is repeated continuously.

Tips and Tricks

While running this program, try moving objects around in front of the sensor to experiment with how
wide the sensors field of view is.
Example 3: Gradually Slow Down Before Reaching an Object

This program makes a robot gradually slow down and then stop about 10 cm away from anything it
detects in front of it. The closer it gets to the object, the slower it will drive.
The program uses the Ultrasonic Sensor block in the Measure Distance Centimeters mode to get a
distance measurement and get the resulting number on a data wire. A Math block then subtracts 10 from
the distance, and the result is wired to the Power input of a Move Steering block. Shorter distances result
in lower power, and when the distance reaches 10 cm, the power will be zero, and the robot will stop. The
process is repeated in a loop so that the motor power is adjusted continuously based on new distance
measurements.

Tips and Tricks


You can also try moving the object while this program is running. The robot will continuously adjust its
speed.

ULTRASONIC SENSOR BLOCKS AND MODES


The table below shows all of the programming blocks and modes that you can use with the Ultrasonic
Sensor. The Distance modes have sub-modes that let you choose between centimeters and inches.
Block

Mode

Use

Wait

Ultrasonic Sensor - Compare


Distance

Wait for the distance to reach a certain value.

Wait

Ultrasonic Sensor - Compare


Presence

Wait, in listen only mode, for an ultrasonic signal to be detected.

Wait

Ultrasonic Sensor - Change


Distance

Wait for the distance to change by a certain amount.

Loop

Ultrasonic Sensor Compare - Distance

Ripetere una sequenza di blocchi finch la distanza raggiunge un


certo valore.

Loop

Ultrasonic Sensor Compare Presence

Repeat a sequence of blocks until an ultrasonic signal is detected, in listen only


mode.

Loop

Ultrasonic Sensor Change Distance

Repeat a sequence of blocks until the distance changes by a certain amount.

Switch

Ultrasonic Sensor Compare Distance

Choose between two sequences of blocks based on the distance.

Switch

Ultrasonic Sensor Compare Presence

Choose between two sequences of blocks based on whether an ultrasonic signal is


detected in listen only mode.

Ultrasonic
Sensor

Measure Distance

Measure the distance and get the result on a Numeric data wire.

Ultrasonic
Sensor

Measure Presence

Listen for other ultrasonic signals in listen only mode, and get the result on a Logic
data wire.

Ultrasonic
Sensor

Compare Distance

Compare the distance to a threshold, and get the result on a Logic data wire.

Ultrasonic

Compare Presence

Listen for other ultrasonic signals in listen only mode, and get the result on a Logic

Sensor

Ultrasonic
Sensor

data wire.

Advanced

Data Logging

Similar to Measure Distance, but with the option to make only a single sound ping.

See Data Logging.

Using the Color Sensor


The Color Sensor can detect the color or intensity of light that enters the small window on the face of the
sensor. The Color Sensor can be used in three different modes: Color Mode, Reflected Intensity Mode,
and Ambient Intensity Mode.

COLOR MODE
In Color mode, the Color Sensor can detect the color of a nearby object, or the color of a surface near the
sensor. You can use the Color mode to detect, for example, the color of a LEGO part held close to the
sensor, or the color of different markings on a piece of paper.

Tips and Tricks


When the Color Sensor is in Color mode, red, green, and blue LED lights on the front of the sensor will
turn on.
The sensor can detect seven different colors: black, blue, green, yellow, red, white, and brown. An object
that is not one of these colors may be detected as No Color, or it may be detected as a similar color. For
example, an orange object might be detected as red or yellow, depending on how much red the orange
has in it, or as brown or black if the orange is very dark or too far away from the sensor.

Tips and Tricks


The object or surface should be very close to the sensor (but not touching it) to be detected accurately.

REFLECTED LIGHT INTENSITY MODE


In Reflected Light Intensity mode, the Color Sensor detects the intensity of light that enters the sensor.
The intensity of the light is measured as a percentage from 0 to 100, with 0 being very dark, and 100
being very bright.
When the Color Sensor is in Reflected Light Intensity mode, a red LED light on the front of the sensor will
turn on. If the sensor is close to an object or surface, this red light will reflect off of the object and then
enter the sensor to be detected. You can use this to measure shades of color on a surface or object,
because darker shades of color will reflect less of the red light back to the sensor.

Si pu utilizzare questa modalit, ad esempio, per far seguire al robot una linea nera
su una superficie bianca. Quando il sensore passa sopra la linea nera, la misurazione
della luce diminuir gradualmente. Questo pu essere usato per dire quanto vicino il
robot alla linea.

Tips and Tricks

The Reflected Light Intensity mode measures the total amount of light entering the sensor. This
includes the reflection of the red LED, plus any lights in the room. The sensor should be
positioned close to (but not touching) the surface being measured, to reduce the effect of outside
light sources.
AMBIENT LIGHT INTENSITY MODE
In Ambient Light Intensity mode, like the Reflected Light Intensity mode, the Color Sensor detects the
intensity of light that enters the sensor. The intensity of the light is measured as a percentage from 0 to
100, with 0 being very dark, and 100 being very bright.
In Ambient Light Intensity mode, a blue LED light on the front of the sensor will turn on dimly. This blue
light helps you identify that the sensor is in Ambient Light Intensity mode, but it does not affect the light
measurement unless an object is very close to the sensor.
You can use this mode to detect the brightness of the room lights, or when other light sources shine on
the sensor. You could use this also to detect when the lights to a room are turned on, or when a flashlight
is shined on your robot.

COLOR SENSOR DATA


The Color Sensor can give the following data:

Data

Type

Range

Notes

Color

Numeric

0-7

Used in Color mode.


0 = No Color
1 = Black
2 = Blue
3 = Green
4 = Yellow
5 = Red
6 = White
7 = Brown

Light

Numeric

0-100

Used in Reflected Light Intensity and Ambient Light Intensity


modes. Measures light intensity as a percentage, 0 = darkest, 100
= brightest.

Example 1: Drive until a Black Line is Reached (Method 1)

This program makes a robot drive until the Color Sensor detects a black color, then it stops. The program
uses theWait block in the Color Sensor - Compare Color mode to test for the black color.

Tips and Tricks

If you use this program with the Color Sensor on your robot pointing downwards and close to a lightcolored surface with a thick black line on it, the robot can drive until it reaches the line.
Example 2: Drive until a Black Line is Reached (Method 2)

This program makes a robot drive until the Color Sensor detects a dark color, then it stops. The program
uses theWait block in the Color Sensor - Compare Reflected Light Intensity mode to wait until the light
intensify becomes less than 50%.

Tips and Tricks

Compared to the method in Example 1 above, this program allows you to adjust how dark the line needs
to be, by changing the Threshold Value (here 50%). Also, the robot will stop on any dark color, not just
black.
Example 3: Drive Only When the Room Lights Are On

Questo programma fa un muovere il robot quando le luci della stanza sono accese e lo fermano quando si
spegne la luce. Il programma utilizza un interruttore con sensore di colore - Confronto - Modalit intensit di
luce ambientale per verificare se la luce superiore al 20%. Lo switch decide se attivare i motori ON o OFF.
L'interruttore viene ripetuto in un ciclo in modo che il robot continui a reagire ai cambiamenti di luce.
Example 4: Say Red, Green, and Blue when Detected

This program makes the EV3 say Red, Green, and Blue when the Color Sensor detects these colors.
The program uses a Switch in the Color Sensor Measure Color mode to choose between different
Sound blocks based on the color that is detected. A No Color case is added and selected as the default
so that the EV3 wont say anything when one of the three colors is not seen.
Example 5: Display a Reflected Light Meter

This program puts a graphical light meter on the EV3 Display.Il

programma utilizza Color Sensor


block in the Measure Reflected Light Intensity mode per misurare la luce riflessa (0-

100) e ottenere il risultato su un data Wire. The result is then multiplied by 1.78 to scale it to
the EV3 screen width (178 pixels) and then used as the width of a filled rectangle shape. The process is
repeated in a loop so that the display is continuously updated.

Tips and Tricks

While running this program, try moving the Color Sensor over surfaces of different colors and shades. You
will be able to see which colors reflect more light.

COLOR SENSOR BLOCKS AND MODES


The table below shows all of the programming blocks and modes that you can use with the Color Sensor.

Block

Mode

Use

Wait

Color Sensor Compare - Color

Wait for the sensor to detect one of the selected colors.

Wait

Color Sensor Compare - Reflected


Light Intensity

Wait for the reflected light intensity to reach a certain


value.

Wait

Color Sensor Compare - Ambient


Light Intensity

Wait for the ambient light intensity to reach a certain


value.

Wait

Color Sensor - Change


- Color

Wait for the detected color to change.

Wait

Color Sensor - Change


- Reflected Light
Intensity

Wait for the reflected light intensity to change by a


certain amount.

Wait

Color Sensor - Change


- Ambient Light
Intensity

Wait for the ambient light intensity to change by a


certain amount.

Loop

Color Sensor - Color

Repeat a sequence of blocks until one of the selected


colors is detected.

Loop

Color Sensor Reflected Light


Intensity

Repeat a sequence of blocks until the reflected light


intensity reaches a certain value.

Loop

Color Sensor - Ambient


Light Intensity

Repeat a sequence of blocks until the ambient light


intensity reaches a certain value.

Switch

Color Sensor - Measure

Choose between two or more different sequences of

- Color

blocks depending on which color is detected.

Switch

Color Sensor Compare - Color

Choose between two sequences of blocks depending on


whether or not one of the selected colors is detected.

Switch

Color Sensor Compare - Reflected


Light Intensity

Choose between two sequences of blocks depending on


the reflected light intensity.

Switch

Color Sensor Compare - Ambient


Light Intensity

Choose between two sequences of blocks depending on


the ambient light intensity.

Color
Sensor

Measure - Color

Measure the detected color (0-7) and get the result on a


Numeric data wire.

Color
Sensor

Measure - Reflected
Light Intensity

Measure the reflected light intensity (0-100) and get the


result on a Numeric data wire.

Color
Sensor

Measure - Ambient
Light Intensity

Measure the ambient light intensity (0-100) and get the


result on a Numeric data wire.

Color
Sensor

Compare - Color

Confronta il colore rilevato da uno o pi colori


scelti, e mette il risultato su un Logic data wire
(True se corrisponde a uno qualsiasi dei colori
selezionati).

Color
Sensor

Compare - Reflected
Light Intensity

Compare the reflected light intensity to a threshold, and


get the result on a Logic data wire.

Color
Sensor

Compare - Ambient
Light Intensity

Compare the ambient light intensity to a threshold, and


get the result on a Logic data wire.

Data
Logging

See Data Logging.

Using the Timer


The Timer can be used to measure time intervals. The Timer is used like a sensor, but it is internal to the
EV3 Brick and does not require a sensor port. You could use the Timer to measure, for example, how long
it takes your robot to move a certain distance.
The EV3 has eight timers, so you can time up to eight different things together. You can reset a timer to
zero at any point in your program, and it will start timing from that point.

Tips and Tricks

If you simply want to wait for a certain amount of time in your program, you can use the Wait block in
the Wait Time mode. Using the Timer lets you reset the timer and test the timer at different places in
your program.

TIMER DATA
The Timer gives the following data:

Data
Elapsed Time

Type
Numeric

Notes
Elapsed time since the timer was last reset, in seconds.

Tips and Tricks


Tip: Time is measured in seconds using a decimal number. An interval of one tenth of a second would
result in an Elapsed Time of 0.1 seconds.

RESETTING A TIMER
You can reset a timer to zero (0.0 seconds) at any point in your program by using the Timer block in
Reset mode. After a timer is reset, it starts timing again immediately from zero. All eight timers are
automatically reset at the beginning of a program and are always running.

Tips and Tricks

If you measure a timer that has never been reset, you will get the elapsed time since the program
started.

EXAMPLES USING THE TIMER

Esempi di come possibile utilizzare il timer nel programma sono riportati di seguito.
Example 1: Make a Motor Move Once every Second

This program makes a motor turn 45 degrees exactly once every second, like a ticking clock. The
program uses theMedium Motor block to turn the motor by 45 degrees, which will take a bit of time, but
less than 1 second. Then the program needs to wait for the remainder of the 1-second interval to end
before moving the motor again. To do this, the program starts timer 1 before starting the motor by using
the Timer block in Reset mode. Then after the motor stops, a Wait block in Timer Compare - Time
mode waits for timer 1 to reach 1 second. This will make the total interval 1 second, including both the
time the motor is moving and the time it is stopped.

Example 2: Measure How Long a Touch Sensor is Held in

Questo programma misura per quanto tempo il tasto viene premuto ogni volta, e il risultato in
pochi secondi viene visualizzato sul display EV3. Il programma attende la pressione di un tasto
e ne aspetta il rilascio. Alla pressione del tasto il timer 1 viene azzerato usando il Timer block
in Reset mode. Dopo il rilascio, il tempo trascorso viene misurato usando il Timer block in
Measure Time mode. Il risultato in secondi is wired to a Display block to be displayed.

TIMER BLOCKS AND MODES


The table below shows all of the programming blocks and modes that you can use with Timer.
Block

Mode

Use

Wait

Timer - Compare Time

Wait for a timer to reach a certain value.

Wait

Timer Change - Time

Wait for a timer to change by a certain amount.

Loop

Timer

Repeat a sequence of blocks until a timer reaches a certain value.

Switch

Timer

Choose between two sequences of blocks based on a timer.

Timer

Measure

Read a timer, and get the result in seconds on a Numeric data wire.

Timer

Compare

Compare a timer to a threshold, and get the result on a Logic data wire.

Timer

Reset

Reset a timer to zero. The timer starts timing again immediately.

Tips and Tricks


Simple uses of timers may also be able to use the following blocks and modes:

Block

Mode

Use

Wait

Time

Wait for a certain amount of time.

Loop

Time

Repeat a sequence of blocks for a certain amount of time.

Using the Touch Sensor


The Touch Sensor detects whether the button on the face of the sensor is
pressed in. You can use a Touch Sensor to detect, for example, when your
robot drives into something. You could also use a finger press on a Touch
Sensor to trigger an action.

The Touch Sensor can indicate that it is either pressed in, or not. It cannot measure how far or how hard
the button is pressed in. The Touch Sensor gives Logic data (True or False). The position of the Touch
Sensor button is called its State, and is True for pressed in and False for not pressed in (released).
The Touch Sensor can also keep track of whether the button has been pressed and then released in the
past. This is called Bumped and is useful to detect, for example, finger presses. See Understanding
Bumped for more information.

TOUCH SENSOR DATA


The Touch Sensor can give the following data:

Data

Type

Notes

State

Logic

True if the button is pressed in, False if not.

Pressed

Logic

True if pressed, False if not (same as State).

Released

Logic

False if pressed, True if not (opposite of State).

Bumped

Logic

True if the button has been pressed and released in the past. The next
Bumped occurrence will then require a new press and release.

EXAMPLES USING PRESSED


Some examples of how you can use the Pressed data of the Touch Sensor are below.
Example 1: Drive until a Touch Sensor is Pressed

This program makes a robot drive straight forward until a Touch Sensor is pressed, then the robot is
stopped. It uses the Wait block with the Touch Sensor - Compare Touch mode to test for Pressed.

Tips and Tricks

Remember to use the On mode of the Move Steering block when you want to drive while waiting for a
sensor.
Example 2: Run a Motor whenever a Touch Sensor is Held in (Method 1)

This program makes a motor run whenever the Touch Sensor is pressed and held in. The motor is
stopped whenever the Touch Sensor is released. The program uses a Switch block with the Touch Sensor
- Compare Touch mode to test for Pressed. The result of the test is used to choose between turning the
motor on or off. The test is repeated continuously in a Loop.
Example 3: Make the Brick Status Light Pulse whenever a Touch Sensor is Held in

This program turns the Brick Status Light on in orange, and makes it pulse whenever the Touch Sensor is
held in. It uses the Touch Sensor block in Measure mode to get the state of the Touch Sensor. The result
is wired to the Pulse input of the Brick Buttons block with a Logic data wire.

EXAMPLES USING RELEASED

Some examples of how you can use the Released data of the Touch Sensor are below.
Example 4: Beep on each Touch Sensor Press

This program sounds a short tone each time the Touch Sensor is pressed. Only one tone is sounded for
each press. The program uses a Wait block in the Touch Sensor - Compare Touch mode to test for
Pressed and then anotherWait block to wait for Released before letting the loop continue.

Tips and Tricks

If you delete the Wait for Release from this program, you will find that the tone will repeat as long as the
Touch Sensor is held in. This is because the Wait for Pressed will immediately continue to the next block if
the Touch Sensor is already pressed. Try it!
Example 5: Run a Motor whenever a Touch Sensor is Held in (Method 2)

This program makes a motor run whenever the Touch Sensor is pressed and held in. The motor is
stopped whenever the Touch Sensor is released. The program uses a Wait block in the Touch Sensor Compare Touch mode to wait for Pressed to start the motor, then another Wait to wait for Released
before stopping the motor. The process is repeated in a Loop.

Tips and Tricks

This program does the same thing as Example 2 above, using a different method.

UNDERSTANDING BUMPED
In addition to telling you whether the Touch Sensor button is currently pressed or released, the Touch
Sensor also keeps track of whether it has been pressed and released in the past, which is called Bumped.
This makes it easy to find out whether a Touch Sensor has been pressed like a pushbutton, without
needing to check it constantly for a press and then wait for the release.
Once a Touch Sensor indicates that it has been Bumped, it will not indicate Bumped again until the Touch
Sensor is pressed and then released a new time. This makes it easy to make sure that, for example, each
press corresponds to an action happening only once.
The table below shows an example where a Touch Sensor is pressed and released twice as a series of
steps. The table shows the result of a program testing for Pressed, Released, and Bumped after each
action.

Step
1

Action
Button starts released

Pressed
False

Released
True

Bumped
False

Button is pressed in

True

False

False

Button is released

False

True

True

Button is still released, and the program tests the


Touch Sensor again

False

True

False

Button is pressed a second time

True

False

False

Button is held in, and the program tests the Touch


Sensor again

True

False

False

Button is released

False

True

True

Button is still released, and the program tests the


Touch Sensor again

False

True

False

Note that when the button is held in, the Touch Sensor will continue to indicate Pressed each time the
program tests it. However, once the button is released, the sensor will only indicate Bumped the first time
the program tests it for Bumped. The sensor will not indicate Bumped again until it is pressed and
released a new time.

EXAMPLES USING BUMPED

Some examples of how you can use the Bumped data of the Touch Sensor are shown below.
Example 6: Change the Display when the Touch Sensor is Pressed

This program will make the EV3 Brick Display show Zero, then One, then Two, changing the Display
each time the Touch Sensor is bumped (pressed and then released).

Tips and Tricks

If you change the Wait for blocks in this program to test for Pressed instead of Bumped, you will find that
the display goes from Zero directly to Two, skipping One. Try it! This is because the Display blocks
execute so quickly that when the second Wait for Pressed test happens, your finger is still holding the
button in from the first press, so the second Wait for ends immediately. When testing for Bumped, only
one test will succeed for each different press.
Example 7: Drive in a Pattern until the Touch Sensor is Pressed

This program makes a robot repeat a pattern of driving straight and then turning, until a Touch Sensor,
acting as a Stop button on the robot, is pressed. After the Touch Sensor is pressed, the robot will stop
after the next turn. The program uses a Loop in Touch Sensor mode to repeat the driving until the Touch
Sensor is Bumped (pressed and then released).

Tips and Tricks

If you try this program using Pressed instead of Bumped, you will find that pressing the Touch Sensor
usually does not make the robot stop. Try it! This is because the loop tests the sensor only briefly after
the two Move blocks have completed. If you press and release the sensor while the Move blocks are
running, the Pressed state will not be seen. Using Bumped, the Touch Sensor remembers that it was
pressed and released in the past.

TOUCH SENSOR BLOCKS AND MODES


The table below shows all of the programming blocks and modes that you can use with the Touch Sensor.

Block

Mode

Use

Wait

Touch Sensor
Compare

Wait for the Touch Sensor to be Pressed, Released, or Bumped.

Wait

Touch Sensor Change

Wait for the Touch Sensor state to change.

Loop

Touch Sensor

Repeat a sequence of blocks until the Touch Sensor is Pressed,


Released, or Bumped.

Switch

Touch Sensor

Choose between two sequences of blocks depending on


whether the Touch Sensor is Pressed or not, Released or not, or
Bumped or not.

Touch
Sensor

Measure

Get the current Touch Sensor state (Pressed or not) on a Logic


data wire.

Touch
Sensor

Compare

Test the Touch Sensor for Pressed, Released, or Bumped, and


get the result on a Logic data wire.

Data
Logging

See Data Logging.

Using the Brick Buttons

The Brick Buttons are the five buttons (Left, Center, Right, Up, and Down) on the face of the EV3 Brick.
You can use the Brick Buttons like a sensor to detect if a button is pressed, and to find out which button
is pressed.
You can use the Brick Buttons to make your program respond to button presses. For example, you could
make a robot arm lift up and down when the Up and Down buttons are pressed.

Tips and Tricks

The Back button on the EV3 is not included in the Brick Buttons. Pressing the Back button aborts a
running program.
The Brick Buttons can also keep track of whether a button has been pressed and then released in the
past. This is called Bumped, and it works the same as the Bumped state of the Touch Sensor. See
Understanding Bumped Using the Touch Sensor for more information.

BRICK BUTTONS DATA

The Brick Buttons can give the following data:

Data

Type

Notes

Button
ID

Numeri
c

Indicates which button is currently pressed:


0 = None
1 = Left
2 = Center
3 = Right
4 = Up
5 = Down

Pressed

Logic

For a specified Button ID (1-5), True if the button is pressed, False if not.

Released

Logic

For a specified Button ID (1-5), False if the button is pressed, True if not.

Bumped

Logic

For a specified Button ID (1-5), True if the button has been pressed and
released in the past. The next Bumped occurrence will then require a new
press and release.

Tips and Tricks


The Brick Buttons cannot detect when more than one button is pressed at the same time. If you press
two buttons at the same time, one button will override the other.

EXAMPLES USING THE BRICK BUTTONS


Some examples of how you can use the Brick Buttons in a program are below.
Example 1: Press a Button to Continue

This program makes a robot drive forward for one second, then it displays Press a Button. It then
waits for one of the Brick Buttons to be pressed before driving backward for one second. The program
uses the Wait block with the Brick Buttons - Change mode to wait for any brick button to be pressed.
Example 2: A Brick Buttons Control Panel

This program makes a robot turn left when the Left button is pressed, and turn right when the Right
button is pressed. The program uses a Switch block with the Brick Buttons - Measure mode to find out
which of the Brick Buttons is pressed. The three different cases in the Switch make the robot: turn left
when the Left button is pressed, turn right when the Right button is pressed, and stop when no button is
pressed. The test is repeated continuously in a Loop.

Tips and Tricks

Try using the + button on the Switch to add more cases. For example, you might make the robot drive
forward and backward when you press the Up and Down buttons.

Example 3: Control the Brick Status Light Color with the Brick Buttons

This program turns the Brick Status Light on in green when you press the Left button, in orange when
you press the Center button, and in red when you press the Right button. First, it uses a Switch block in
the Brick Buttons - Compare mode to test whether the Left, Center, or Right button is pressed. If not,
a Brick Status Light block turns the light off. If one of the three buttons is pressed, a Brick Buttons block
in Measure mode gets the Button ID of the pressed button (1-3) on a Data Wire. A Math block then
subtracts 1 from this value so that it can be used as the Color input (0-2) to the Brick Status Light block.

BRICK BUTTONS BLOCKS AND MODES


The table below shows all of the programming blocks and modes that you can use with the Brick Buttons.

Block

Mode

Use

Wait

Brick Buttons
Compare

Wait for one of the selected Brick Buttons to be Pressed, Released, or


Bumped.

Wait

Brick Buttons
Change

Wait for the pressed Brick Button (Button ID) to change. If no Brick
Button is pressed at the start of the block, this will wait for any Brick
Button to be pressed.

Loop

Brick Buttons

Repeat a sequence of blocks until one of the selected Brick Buttons is


Pressed, Released, or Bumped.

Switch

Brick Buttons Measure

Choose between two or more sequences of blocks depending on which


Brick Button is pressed.

Switch

Brick Buttons Compare

Choose between two sequences of blocks depending on whether one of


the selected Brick Buttons is Pressed, Released, or Bumped.

Brick
Buttons

Measure

Get the Button ID of the currently pressed Brick Button (0 if none is


pressed) on a Numeric data wire.

Brick
Buttons

Compare

Test whether one of the selected Brick Buttons is Pressed, Released, or


Bumped, and get the result on a Logic data wire.

Using the Motor Rotation Sensor

The Motor Rotation sensor is used to measure how far a motor has turned. A rotation sensor is built into
the Medium Motor, the Large Motor, and the NXT Motor. The sensors in these motors can detect an
amount of rotation in degrees. A full turn of a motor is 360 degrees of rotation.
You can also use the Motor Rotation sensor to find out what power level a motor is currently running at.

Tips and Tricks


A Motor Rotation sensor is used with a motor that is connected to a motor port on the EV3 Brick (A, B, C,
or D). Motor Rotation sensors cannot be used with the EV3 sensor ports (1, 2, 3, and 4).

MOTOR ROTATION DATA


A Motor Rotation sensor can give the following data:

Data

Type

Notes

Degrees

Numeri
c

Amount of rotation in degrees

Rotations

Numeri
c

Amount of rotation expressed in rotations (degrees/360, as a decimal


number)

Current
Power

Numeri
c

Current motor power level if the motor is running (1-100), or 0 if the


motor is stopped

RESETTING A MOTOR ROTATION SENSOR


A Motor Rotation sensor can be reset to zero at any point in a program. The sensor will then measure the
total amount of rotation relative to the reset point. To reset a Motor Rotation sensor, use the Motor
Rotation block in the Reset mode.

Tips and Tricks


If you measure a Motor Rotation sensor that has never been reset, you will get the total amount of
rotation that the motor has turned since the program started.

MOTOR ROTATION DIRECTION AND TOTAL ROTATION


Forward rotation of a motor results in a positive number of degrees or rotations, and backward rotation
results in a negative number. Rotation is always measured as the total amount of forward rotation since
the sensor was last reset. Backward rotation is subtracted from any accumulated forward rotation.
The table below shows an example of motor actions happening in several steps and the result of
measuring the motor rotation after each step.

Step
1

Action
Program starts, motor has not turned yet

Motor Rotation is then:


0 degrees

Motor turns forward one full turn (360 degrees)

360 degrees

Motor turns forward one full turn again

720 degrees

Motor turns forward 60 degrees

780 degrees

Motor turns backward for 30 degrees

750 degrees

Motor Rotation is reset

0 degrees

Motor turns backward for 100 degrees

-100 degrees

Motor turns backward for 60 degrees

-160 degrees

Motor turns forward for 360 degrees

200 degrees

EXAMPLES USING THE MOTOR ROTATION SENSOR


Some examples of how you can use the Motor Rotation sensor in your program are shown below.
Example 1: Make a Sound when your Robot is Pushed

This program makes a robot make a sound when it is pushed by hand so that the wheels move a little bit.
The program uses the Wait block in the Motor Rotations Change Degrees mode to wait for the
rotation sensor for motor C to change by 5 degrees in either direction. Then a Sound block makes a
sound.
Example 2: Drive in a Pattern for a Certain Distance

This program makes a robot drive straight for 2 rotations and then drive in a zigzag pattern for 6.5 total
rotations. It drives in a zigzag pattern by moving first one wheel, then the other. The zigzag pattern is
repeated in a Loopuntil motor B has driven a total of 6.5 rotations. The program uses the loop in the
Motor Rotation Rotations mode to stop the loop when the rotation sensor for motor B measures a total
of 6.5 rotations. To make the 6.5 rotations measure only the zigzag driving, not including the 2 straight
rotations in the beginning, the rotation sensor for motor B is reset to zero before the zigzag driving using
the Motor Rotation block in the Reset mode.
Example 3: A Speed Control Dial

This program makes the motor connected to port C act like a speed control dial for the motor connected
to port B. Turning the C motor forward and backward by hand will control the speed of the B motor. The
program uses theMotor Rotation block in the Measure Degrees mode to measure the degrees turned by
motor C. This result is used for the Power input of a Large Motor block and also displayed using
a Display block. The process is repeated in a Loop so that the speed is continuously updated.

Tips and Tricks

If the Power input to the Large Motor block is greater than 100, it will use 100% power.

MOTOR ROTATION BLOCKS AND MODES


The table below shows the programming blocks and modes that you can use with the Motor Rotation
Sensor.

Block

Mode

Use

Wait

Motor Rotation Compare

Wait for a rotation sensor to reach a certain value (Degrees,


Rotations, or Current Power).

Wait

Motor Rotation Change

Wait for a rotation sensor to change by a certain amount


(Degrees, Rotations, or Current Power).

Loop

Motor Rotation

Repeat a sequence of blocks until a rotation sensor reaches a


certain value (Degrees, Rotations, or Current Power).

Switch

Motor Rotation

Choose between two sequences of blocks based on a rotation


sensor (Degrees, Rotations, or Current Power).

Motor
Rotation

Measure

Read a rotation sensor (Degrees, Rotations, or Current


Power), and get the result on a Numeric data wire.

Motor
Rotation

Compare

Compare a rotation sensor (Degrees, Rotations, or Current


Power) to a threshold, and get the result on a Logic data wire.

Motor
Rotation

Reset

Reset a rotation sensor to zero.

Data
Logging

See Data Logging.

Tips and Tricks


Motor Rotation sensors are also used internally in the following Action blocks and modes:

Blocks

Modes

Use

Medium
Motor,
Large Motor

On for
Degrees,
On for
Rotations

Turn a motor by a certain number of degrees or rotations.

Move
Steering,
Move Tank

On for
Degrees,
On for
Rotations

Drive using two Large Motors for a certain number of


degrees or rotations.

Using the Gyro Sensor


The Gyro Sensor detects rotational motion. If you rotate the Gyro Sensor in
the direction of the arrows on the case of the sensor, the sensor can detect the
rate of rotation in degrees per second. You can use the rotation rate to detect,
for example, when a part of your robot is turning, or when your robot is
falling over.
In addition, the Gyro Sensor keeps track of the total rotation angle in degrees.
You can use this rotation angle to detect, for example, how far your robot has
turned.

GYRO SENSOR DATA

The Gyro Sensor can give the following data:

Data

Type

Notes

Angl
e

Numeri
c

Rotation angle in degrees.


Measured from the last reset. Reset with the Reset mode of the Gyro
Sensor block.

Rate

Numeri
c

Rotation rate in degrees per second.

Tips and Tricks

The Gyro Sensor can only detect motion around a single axis of rotation. This direction is
indicated by the arrows on the case of the sensor. Make sure you attach the sensor to your robot in
the correct orientation to measure rotation in the desired direction.
The Angle and Rate can both be either positive or negative. Clockwise rotation is positive and
counter-clockwise is negative.
When connecting the Gyro Sensor to your EV3 Brick, you must hold it completely still in order
to minimize drifting
The Angle may drift over time and become less accurate. For best results, reset the angle using
the Reset mode of the Gyro Sensor block before every motion that you want to measure the angle
of.
The Motor Rotation sensor can also measure rotation in degrees, but only for the rotating part of a
motor.
EXAMPLES USING THE GYRO SENSOR
Examples of how you can use the Gyro Sensor in your program are shown below.
Example 1: Turn by a Specified Angle

This program makes a robot turn 90 degrees to the left. It uses the Wait block with the Gyro Sensor Change Angle mode to wait for the rotation angle to change by 90 degrees.

Tips and Tricks


Tip: Because the program above uses the Change mode of the Wait block, it measures the change in
angle relative to the start of the Wait Block. Therefore, it is not necessary to reset the Gyro Sensor before
the movement.
Example 2: Display a Rotation Rate Meter

This program has the robot display the rotation rate graphically. The Gyro Sensor block measures the
numeric value of the rotation rate, and this value is used to vary the width of a rectangle on the EV3
Display.

GYRO SENSOR BLOCKS AND MODES

The table below shows the programming blocks and modes that you can use with the Gyro Sensor.

Block

Mode

Use

Wait

Gyro Sensor Compare

Wait for the rotation angle or rate to reach a certain value.

Wait

Gyro Sensor Change

Wait for the rotation angle or rate to change by a certain


amount.

Loop

Gyro Sensor

Repeat a sequence of blocks until the rotation angle or rate


reaches a certain value.

Switch

Gyro Sensor

Choose between two sequences of blocks based on the


rotation angle or rate.

Gyro
Sensor

Measure

Measure the rotation angle and/or rate, and get the result on
a Numeric data wire.

Gyro

Compare

Compare the rotation angle or rate to a threshold, and get the

Sensor

result on a Logic data wire.

Gyro
Sensor

Reset

Reset the rotation angle to zero.

Data
Logging

Gyro Angle
Gyro Rate

See Data Logging.

Using the NXT Sound Sensor


The NXT Sound Sensor measures the intensity (volume) of sound using the microphone on the face of
the sensor. For example, you can use the sound sensor to make your robot react to a loud sound such a
hand clap.

SOUND SENSOR DATA


The Sound Sensor can give the following data:

Data

Type

Range

Notes

Sound Level
(dB)

Numeri
c

0 to
100

Sound level, scaled to a percentage (0-100%)

Sound Level
(dBA)

Numeri
c

0 to
100

Sound level, adjusted to approximate human ear


sensitivity, and then scaled to a percentage (0-100%)

The Sound Level (dBA) value is adjusted to approximate the sensitivity of the human ear to different
frequencies. This means that sound frequencies that are heard by the sensor but are hard for you to year
will not result in a high sound level value.

Tips and Tricks

Quiet sounds and normal talking usually result in sound levels less than 50%. A hand clap or loud
voice will usually produce a level greater than 50%.
EXAMPLES USING THE SOUND SENSOR
Some examples of how you can use the NXT Sound Sensor in your program are shown below.
Example 1: Start Your Robot with a Clap

This program makes your robot start driving when you clap your hands. It uses the Wait block in the
Sound Sensor Compare dB mode to wait until the sound level rises above 50%.
Example 2: Sound Controlled Speed

This program makes your robot drive forward, with the speed of the robot controlled by the sound level.
The louder you yell at the robot, the faster it will drive! The program uses the NXT Sound Sensor block in
the Measure dBA mode to get the sound level on a Numeric data wire. The result is wired to the Power
input of a Move Steeringblock to make the sound level control the motor power. The process is repeated
in a Loop so that the motor power is continuously adjusted based on new sound readings.

BLOCKS THAT CAN USE THE SOUND SENSOR


The table below lists the different programming blocks that can be used with the NXT Sound Sensor. Each
block will have different modes for the dB and dBA data provided by the sensor.

Block

Mode

Use

Wait

Sound Sensor Compare

Wait for the sound level to reach a certain value.

Wait

Sound Sensor Change

Wait for the sound level to change by a certain amount.

Loop

Sound Sensor

Repeat a sequence of blocks until the sound level


reaches a certain value.

Switch

Sound Sensor

Choose between two sequences of blocks based on the


sound level.

NXT Sound
Sensor

Measure

Measure the sound level and get the result on a


Numeric data wire.

NXT Sound
Sensor

Compare

Compare the sound level to a threshold and get the


result on a Logic data wire.

Data Logging

See Data Logging.

tool
s

Image Editor
The Image Editor allows you to create images and text to display on your EV3 Brick. You can also edit
existing image files. The Image Editor can open .rgf, .jpg, .png, and .bmp files.
Select Image Editor: on the Tools menu, click Image Editor.

The editing process has five steps:

1. Open your image


2. Change its size and placement
3. Adjust the contrast
4. Edit the image, using the tool palette to the left of the editing screen.
5. Save the image into your project.
OPENING AND RESIZING THE IMAGE
Open your picture to begin editing.
Use the zoom buttons to adjust the size of the image. You can move the image by clicking and dragging
it. The Preview window shows your image exactly as it will be on the EV3 Brick Display (178 pixels wide
by 128 pixels high).

When you are happy with the size and placement of the image, click Next.

ADJUSTING THE CONTRAST

Use the Threshold Slider on the left hand side to adjust the contrast of the image. Changing the contrast
will affect how much detail there is in the final image.

Click Next when you are ready.

EDITING THE IMAGE

You can edit your image further by adding lines, circles, and much more.

Open
New
Save
Cut: removes part of an image from the editing screen.
Copy: copies the selected image.
Paste: places the selected image onto your editing screen. You can click and drag the image
into position. Pasted images can be moved while they are blue. Once they change to black,
they cannot be moved around the editing screen.
Undo, Redo
Pencil: small, medium, or large free form line draw.
Rectangle: small, medium, or large rectangle.
Ellipse: small, medium, or large ellipse.
Select
Line: small, medium, or large width.
Fill

Erase: small, medium, or large eraser.


Text
SAVING THE IMAGE
Save your image when you have finished editing. This will save the image into your Project folder for
future use. The Project Properties Page lists all the images your project uses.

You can find and use your saved image in the Display Block by using Image mode.

Sound Editor
The Sound Editor allows you to record and edit your own sound files. Edited sound files can be saved on
your computer and then used in the Sound block, just like any existing EV3 sound file. You can also edit
existing sound files.
Select Sound Editor from the Tools menu to open the Sound Editor. Open an existing sound file or record
your own sound, use the sliders to crop the sound file, then save the file.
You can import sound files of nearly any length into the Sound Editor, but only sound files no longer than
five seconds (maximum 64 KB) can be saved. Lengthy load times may be expected for large sound files.
The Sound Editor accepts .wav, .mp3 and .rsf sound files.

RECORD AND EDIT SOUNDS

Steps

Open a compatible sound file from your computer.


Record your sound.
Play back the recorded sound.
Move the left and right sliders to select the best portion of your sound for use.
You can zoom in and out to focus on the part of the sound you want.
Adjust the playback volume.
Save the edited sound file.
Record
You can use a microphone built in or connected to your computer. You can record up to 10 seconds of
your own sound by clicking the record button. The recording will automatically stop after 10 seconds.
Clicking the record button will overwrite any sound already recorded.

Adjusting the size


The sound file (waveform image) remains red between the sliders if the file is too large. It will turn purple
when the waveform image between the sliders is about 5 seconds long. The Save button then also
becomes active. The more sound files you create and use, the less memory space you will have on your
EV3 Brick. See Managaing files and Memory for more information about the memory capacity of your EV3
Brick.
Save
By default, the sound file is saved as an uncompressed file to the Sounds folder of the EV3 Software.
Saved files automatically appear in the Sound Block list in Play File Mode.

PLAYING THE EDITED SOUND ON THE EV3 BRICK


Your edited sound file will be listed when the Play File mode is selected in the Sound block. Sounds that
are specific to your current Project will be listed in the Project Sounds folder. The standard Sounds that
are available to all projects are listed in the LEGO Sounds folder. See Sound Block for more information.

Memory Browser
The Memory Browser provides an overview of memory use on your EV3 Brick. You can use the Memory
Browser to transfer programs, sounds, graphics and other files between your EV3 Brick and a computer,
and copy and delete files that are already on your EV3 Brick. See Managing Files and Memory for more
details.

Device Selector: Select either Brick or SD Card


Memory Bar: Graphical overview of used and available memory
File types (Projects, Applications) that take up memory
List of the files stored on the selected device
Copy: Store the selected file for pasting into either the EV3 Brick memory or the SD Card
Paste: Paste a previously stored file into the selected memory device
Delete: Delete the selected files from the selected memory device
Upload: Upload the selected file to your computer
Download: Download a file to your EV3 Brick

Each EV3 Brick has an available memory of 16MB. Some of this memory is used to store example
programs, graphics and sound files that are pre-loaded on the EV3 Brick when you first get it. This leaves
4MB for the files you create and download.
You can restore your EV3 Bricks memory to factory default condition by re-installing the firmware. For
details on this operation, see the Updating the EV3 Firmware. Be aware that re-installing your EV3 Bricks
firmware will delete all files in your EV3 Bricks memory. Make a back up of any files you want to keep
before proceeding!

My Block Builder
Sometimes you make a great mini-program that you want to use again in another Project or Program.

The My Block Builder helps you take this mini-program, which is a number of blocks you select in the
work area, and group them together to create a My Block.
Over time you may develop a library of My Blocks that you can trade with other MINDSTORMS users.

CREATING A MY BLOCK

Lets suppose youve made a mini-program that makes your robot drive in a square:

To convert this mini-program into a block, use the Select tool and select all the blocks you want by
dragging a box around them.
Select My Block Builder from the Tools menu to start the My Block Builder.

Give your block a name and a short description.


Select one of the My Block icons to help identify your block. This example makes the robot drive in a

square, so well use an icon with motors.


Click Finish.
Your mini-program will now be converted into its very own block! All the My Blocks you create for a
Project appear in the My Blocks palette.

You can drag the new My Block onto the Programming Canvas to use it in your program.

Double click on the My Block if you want to edit any part of it.

DOING MORE WITH MY BLOCKS

The My Block we just created to make a square is great, but what happens if you want a bigger square?
Or if you want the robot to drive in a square faster? What if you want a triangle?
You could go into the My Block and change the inputs each time, but there is a better way.
Set up your mini-program, just as you did for the first My Block: Select the blocks you want, then Select
My Block Builder in the Tools menu to start the My Block Builder.
Fill in all the sections just as you did for the first My Block, but dont click Finish just yet. Instead, click
the + symbol on the My Block to add a parameter.

In the Parameter Setup Tab, fill in the appropriate information. This will let us control how big our square
will be.
Set the Default Value, for example, to 1000, just in case you forget to set it when using the My Block in
your own programs. You can even select a slider bar style for your parameter.
In the Parameter Icons tab, select an appropriate image for the parameter. In this example we are
controlling the distance the robot will drive when making a square, so a straight arrow seems
appropriate.

Now that you have added your parameter, click Finish.


The new parameter, Distance, needs to be connected to the input in the mini-program before we can
control it.

Connect the wire coming out of your parameter Distance into the Degrees input of the first Move Tank
block. This lets us control how large of a square the robot will drive (see Data Wires for more
information).

Move back to your main program, and you will now see your My Block, but this time with a parameter to
set the side length for the square mini-program. Depending on the Parameter Style selected above, you
can either enter the value directly or use the slider bars.
What if you want your robot to drive in a triangle or hexagon?
Heres the same My Block, but this time with parameters to control:
1.
2.
3.
4.

The distance to drive for each side (Distance),


How fast the robot goes (Speed),
What angle to turn for each corner, and
How many times to repeat the driving commands.

Tips and Tricks


You can change the order of the parameters on the block in the My Block Builder. Click on the left or right
arrows to move the selected parameter.

Move parameter left


Move Parameter right
Delete Parameter

Wireless Setup
You can setup a wireless connection to your EV3 brick by using the Wireless Setup tool.

The Wireless Setup tool is accessed through the Tools menu or by clicking on the Wireless Setup button
located on the Information tab of your Hardware page.
To Add or Edit a connection select the Add or Edit button and fill in the Network name and/or Password.
To Remove a connection select the network you would like to remove and click Remove.
See Connecting to EV3 for more information.

Block Import
There are manufacturers other than LEGO who create sensors and add-ons that can be used with the EV3
Brick. Often they create custom Programming Blocks which you can download and use in the EV3
Programming environment with their products.

There are four steps required to import an external Block.

1 Download the block file from the manufacturers website to your computer. If it is a
. compressed .zip file, extract the contents to a folder on your computer. Keep note of the location
of the extracted folder. If it is not a .zip file, then follow the manufacturers instructions.
2 Open the Block Import Tool from the Tools menu
.
3 Click the Browse button to locate the folder you extracted the files to and then click OK.
.
4 You will be presented with a list of Blocks that relate to the file you originally download. Select
. the Block you wish to Import. Click Import to finalize the procedure.
The palette in which the newly imported block is placed is determined by the manufacturer and will
happen automatically during installation.

Firmware Update
Firmware is the software that is inside the EV3 Brick. Without its firmware, the EV3 Brick will not work.
Occasionally, the LEGO Group may release new versions of the firmware that add enhanced functions or
fix software bugs. You can have the latest technology and improve your EV3 Bricks performance and
reliability by updating your EV3 Bricks firmware to the most recent version.

UPDATING THE EV3 FIRMWARE


To update the firmware, you need a USB connection from your computer to your EV3 Brick. Your
computer must also be connected to the Internet.

1 Turn your EV3 Brick on and connect it to your computer. Firmware updates can only be done
. with a USB connection.
2 Select Firmware Update in the Tools menu. The Firmware Update dialog box opens, as shown
. here.

3 Click Check (next to Online updates) to see whether new firmware updates are available. If
. available, download them to your computer.
4 Select the most recent firmware version from the Available firmware files. If the desired
. firmware version is not listed, press Browse to locate it.
5 Click Download to download the Firmware to your EV3. The progress bars at the bottom of the
. Firmware Update dialog box will show you how the Firmware Update is proceeding. Once

complete, your EV3 Brick will reset itself.


RE-INSTALLING THE ORIGINAL FIRMWARE
If your EV3 Brick stops working, it may help to re-install the firmware that shipped with your product.

Tips and Tricks

Check your EV3 Brick batteries before reinstalling firmware. Problems may simply be due to worn-down
batteries.
You will need to reset your EV3 Brick before proceeding with re-installation. See "Troubleshooting" in the
printed User Guide for help on resetting your EV3 Brick.
When you have finished resetting your EV3 Brick, follow the instructions above to re-install the firmware
that shipped with your product.

programmin
g
blocks

Medium Motor Block


The Medium Motor block controls the Medium Motor. You can turn the motor
on or off, control its power level, or turn the motor on for a specified amount
of time or rotations.

CHOOSE YOUR MOTOR PORT AND CONTROL MODE

Port selector
Mode selector
Inputs

Select the motor (A, B, C, or D) that you want the Medium Motor block to control by using the Port
Selector on the top of the block.
Use the Mode Selector to select how you want to control the motor. After selecting the mode, you can
choose values for the inputs. The inputs available will change depending on the mode. The modes and
inputs are described below.
Modes: On, Off, On for seconds, On for Degrees, On for Rotations

MODES
On

The On mode turns the motor on, then immediately continues to the next block in the program. You can
control the speed and direction of the motor using the Power input. The motor will run until it is stopped
or changed by another block later in the program, or until the program ends.

Inputs used: Power


Example

Use the On mode when you want other blocks in your program to control how long the motor stays on. In
this program, the motor will run until a touch sensor is pressed, and then it is stopped.
Off

The Off mode turns the motor off. It is usually used to stop a motor that was started by the On mode.
See the example above.
If Brake at End is True, the motor is stopped immediately. The motor will be held in its stopped position
until another Motor block starts that motor, or until the program ends. If Brake at End is False, power to
the motor is simply turned off. The motor will coast using any remaining momentum until it stops, or until
another Motor block starts.
Inputs used: Brake at End

Tips and Tricks


You can use the Off mode with Brake at End set to False to release a motor that is being held in a
stopped position. This can, for example, allow you to adjust the motors position by hand in the middle of
a program.
On For Seconds

On for Seconds turns the motor on for the number of seconds in the Seconds input, then turns it off. The
block will wait until the time has passed before the program will continue to the next block.
You can control the speed and direction of the motor using the Power input. Use True for Brake at End to
stop the motor after exactly the specified number of seconds.
Inputs used: Power, Seconds, Brake at End

Tips and Tricks


You can use a decimal point in the Seconds input to get an exact amount of time, such as 3.5 for three
and a half seconds, and 0.25 seconds for one quarter of a second.
On For Degrees

On for Degrees turns the motor on for the number of degrees specified in the Degrees input, then turns it
off. 360 degrees results in one full turn or rotation of the motor.
You can control the speed and direction of the motor using the Power input. Use True for Brake at End to
stop the motor after exactly the specified number of degrees.
Inputs used: Power, Degrees, Brake at End
Example

This program will run the motor on port A at 50% power for exactly 900 degrees (two and a half
rotations), and then stop it.

Tips and Tricks


The Medium Motors internal rotation sensor measures the degrees of rotation. When using On for
Degrees, the block will wait until the motor has turned exactly the number of degrees specified before the
program will continue to the next block. If the motor encounters resistance or a physical limit, and it is
unable to complete the specified number of degrees, the block will continue waiting. No other blocks in
the program will execute until the resistance is removed.
On For Rotation

On for Rotations turns the motor on for the number of rotations in the Rotations input, then turns it off.
You can control the speed and direction of the motor using the Power input. Use True for Brake at End to
stop the motor after exactly the specified number of rotations.
Inputs used: Power, Rotations, Brake at End

Tips and Tricks


The On for Rotations mode is exactly the same as the On for Degrees mode, except it uses a different
unit of rotation. You can also use a decimal point in the Rotations input to get part of a rotation. The
following table shows two different ways to get the same amount of rotation.

Rotations

Degrees

360

720

0.5

180

1.25

450

7.2

2592

MOTOR POWER AND DIRECTION


The Power input accepts a number from -100 to 100. A positive number turns the Medium Motor
clockwise, and a negative number turns it counter-clockwise, as shown in the graphic below.

Positive Power
Negative Power
You can change the normal rotation direction for a motor using the Invert Motor block. If a motor
direction has been inverted, the effect of positive and negative power levels will be the opposite of that
shown above.

Tips and Tricks

The rotation speed of a motor will be roughly proportional to the power level specified, although rotation
speed is also affected by how much load is put on the motor.

INPUTS
The inputs of the Medium Motor block control the details of how the motor will operate. You can enter the
input values directly into the block. Alternatively, the values can be supplied by Data Wires from the
outputs of other Programming Blocks. The inputs available and their functions depend on the control
mode you selected.

Input

Power

Type

Numeric

Allowed
Values
-100 to 100

Notes

Motor power level.


See Motor Power and Direction.

Brake at
End

Logic

True/False

Applies when the block finishes.


If True, the motor is stopped immediately and is
held in position.
If False, motor power stops and the motor is
allowed to coast.

Seconds

Numeric

Movement time in seconds.

Degrees

Numeric

Any Number

Amount of movement in degrees. 360 degrees


make a full rotation.

Rotations

Numeric

Any Number

Amount of movement in rotations.

Large Motor Block


The Large Motor block controls a Large Motor. You can turn a motor on or
off, control its power level, or turn the motor on for a specified amount of
time or rotation.

CHOOSE YOUR MOTOR PORT AND CONTROL MODE

Port Selector
Mode Selector
Inputs
Select the motor (A, B, C, or D) that you want the Large Motor block to control by using the Port
Selector on the top of the block.
Use the Mode Selector to select how you want to control the motor. After selecting the mode, you can
choose values for the inputs. The inputs available will change depending on the mode. The modes and
inputs are described below.
Modes: On, Off, On for Seconds, On for Degrees, On for Rotations

MODES
On

The On mode turns the motor on, then immediately continues to the next block in the program. You can
control the speed and direction of the motor using the Power input. The motor will run until it is stopped
or changed by another block later in the program, or until the program ends.
Inputs used: Power

Example

Use the On mode when you want other blocks in your program to control how long the motor stays on. In
this program, the motor will run until a touch sensor is pressed, and then it is stopped.
Off

The Off mode turns the motor off. It is usually used to stop a motor that was started by the On mode.
See the example above.
If Brake at End is True, the motor is stopped immediately. The motor will be held in its stopped position
until another Motor block starts that motor, or until the program ends. If Brake at End is False, power to
the motor is simply turned off. The motor will coast using any remaining momentum until it stops, or until
another Motor block starts.
Inputs used: Brake at End

Tips and Tricks


You can use the Off mode with Brake at End set to False to release a motor that is being held in a
stopped position. This can, for example, allow you to adjust the motors position by hand in the middle of
a program.
On For Seconds

On for Seconds turns the motor on for the number of seconds in the Seconds input, then turns it off. The
block will wait until the time has passed before the program will continue to the next block.
You can control the speed and direction of the motor using the Power input. Use True for Brake at End to
stop the motor after exactly the specified number of seconds.
Inputs used: Power, Seconds, Brake at End

Tips and Tricks


You can use a decimal point in the Seconds input to get an exact amount of time, such as 3.5 for three
and a half seconds, and 0.25 seconds for one quarter of a second.
On For Degrees

On for Degrees turns the motor on for the number of degrees of rotation in the Degrees input, then turns
it off. 360 degrees of rotation results in one full turn of the motor.
You can control the speed and direction of the motor using the Power input. Use True for Brake at End to
stop the motor after exactly the specified number of degrees.
Inputs used: Power, Degrees, Brake at End
Example

This program will run the motor on port D at 50% power for exactly 900 degrees (two and a half
rotations), and then stop it.

Tips and Tricks


The Large Motors internal rotation sensor measures the degrees of rotation. When using On for Degrees,
the block will wait until the motor has turned exactly the number of degrees specified before the program
will continue to the next block. If the motor encounters resistance or a physical limit, and it is unable to
complete the specified number of degrees, the block will continue waiting. No other blocks in the program
will execute until the resistance is removed.
On For Rotations

On for Rotations turns the motor on for the number of rotations in the Rotations input, then turns it off.
You can control the speed and direction of the motor using the Power input. Use True for Brake at End to
stop the motor after exactly the specified number of rotations.
Inputs used: Power, Rotations, Brake at End

Tips and Tricks


The On for Rotations mode is exactly the same as the On for Degrees mode, except it uses a different
unit of rotation. You can also use a decimal point in the Rotations input to get part of a rotation. The
following table shows two different ways to get the same amount of rotation.

Rotations

Degrees

360

720

0.5

180

1.25

450

7.2

2592

MOTOR POWER AND DIRECTION


The Power input accepts a number from -100 to 100. Positive and negative numbers make the Large
Motor turn in different directions, as shown in the graphic below.

Positive Power
Negative Power
You can change the normal rotation direction for a motor using the Invert Motor block. If a motor
direction has been inverted, the effect of positive and negative power levels will be the opposite of that
shown above.

Tips and Tricks

The rotation speed of a motor will be roughly proportional to the power level specified, although rotation
speed is also affected by how much load is put on the motor.

INPUTS
The inputs of the Large Motor block control the details of how the motor will operate. You can enter the
input values directly into the block. Alternatively, the values can be supplied by Data Wires from the
outputs of other Programming Blocks. The inputs available and their functions depend on the control
mode you selected.

Input

Type

Allowed
Values

Notes

Power

Numeric

-100 to 100

Motor power level.


See Motor Power and Direction.

Brake at
End

Logic

True/False

Applies when the block finishes.


If True, the motor is stopped immediately and is
held in position.
If False, motor power stops and the motor is
allowed to coast.

Seconds

Numeric

Movement time in seconds.

Degrees

Numeric

Any Number

Amount of movement in degrees. 360 degrees


make a full rotation.

Rotations

Numeric

Any Number

Amount of movement in rotations.

Move Steering Block


The Move Steering block can make your robot drive forward, backward, turn,
or stop. You can adjust the steering to make your robot go straight, drive in
arcs, or make tight turns.
Use the Move Steering block for robot vehicles that have two Large Motors,
with one motor driving the left side of the vehicle and the other the right side.
The Move Steering block will control both motors at the same time, to drive
your vehicle in the direction that you choose.

Left motor
Right motor

Tips and Tricks


Robot vehicles with two drive motors can also be controlled by the Move Tank block. The Move Tank block
is similar to the Move Steering block, but has a different way of controlling turns.

CHOOSE YOUR MOTOR PORTS AND CONTROL MODE

Port Selector
Mode Selector
Inputs
Select the two motors (A, B, C, or D) that you want the Move Steering block to control by using the Port
Selector on the top of the block. Click on each motor letter to choose the port for that motor. The first
port should be the motor on the left side of the vehicle, and the second port should be the motor on the
right side.

Tips and Tricks


Make sure that with your robot facing forward, the motor on the left side is the first one listed in the
Port Selector. Otherwise, your robot will turn in the wrong direction.
Use the Mode Selector to select how you want to control the motors. After selecting the mode, you can
choose values for the inputs. The inputs available will change depending on the mode. The modes and
inputs are described below.
Modes: On, Off, On for Seconds, On for Degrees, On for Rotations

MODES
On

The On mode turns both motors on, then immediately continues to the next block in the program. You
can control the speed and direction of the motors using the Power and Steering inputs. The motors will
run until they are stopped or changed by another block later in the program, or until the program ends.
Inputs used: Power, Steering
Example

Use the On mode when you want other blocks in your program to control how long the motors stay on. In
this program the robot drives forward. When the touch sensor is pressed the robot stops.
Off

The Off mode turns both motors off. Use the Off mode to stop a robot that was started by the On mode
earlier in the program. See the example above.
If Brake at End is True, the motors are stopped immediately. The motors will be held in their stopped
position until another Move or Motor block starts them, or until the program ends. If Brake at End is
False, power to the motors is simply turned off. The motors will coast using any remaining momentum
until they stop, or until another Move or Motor block starts.
Inputs used: Brake at End
On For Seconds

On for Seconds turns both motors on for the number of seconds in the Seconds input, then turns them
off. The block will wait until the time has passed before the program will continue to the next block.
You can control the speed and direction of your robot using the Power and Steering inputs. Use Brake at
End to stop your robot after exactly the specified number of seconds.
Inputs used: Power, Steering, Seconds, Brake at End
Example

This program will make a robot drive straight forward at full power for 2 seconds, then stop.

Tips and Tricks

You can use a decimal point in the Seconds input to get an exact amount of time, such as 3.5 for three
and a half seconds, and 0.25 seconds for one quarter of a second.
On For Degrees

On for Degrees turns both motors on, waits until one of them has turned for the number of degrees of
rotation in theDegrees input, and then turns both motors off. This can be used to make your robot travel
a specific distance or turn a specific amount. 360 degrees of rotation corresponds to one full turn of a
motor.
You can control the speed and direction of your robot using the Power and Steering inputs. Use Brake at
End to stop your robot after exactly the specified number of degrees.
Inputs used: Power, Steering, Degrees, Brake at End
Example 1

The program below will make a robot drive straight forward at 75% power until the motors have turned
900 degrees (two and a half rotations), then stop.

Tips and Tricks


The distance that your robot will travel depends on the Degrees input. However, the distance also
depends on the diameter of the drive wheels used and other physical factors. The internal rotation
sensors in the motors measure the amount of rotation at the motor hubs.

If the Steering input is not zero, one of the motors will be slowed down or reversed to make the robot
turn. In this case, the Degrees input will be measured on the motor that is turning faster.
Example 2

This program will make a robot turn in an arc to the right, using a Steering value of 25 and 50% power.
The turn will continue until the left motor (the outside and faster one) has turned exactly 1000 degrees,
then the robot will stop.

Tips and Tricks

Note that the Degrees input measures the amount of motor rotation of the faster motor, not the change
in the robots direction when turning. The change in the robots direction will depend on wheel diameter,
wheel spacing, and other factors.
On For Rotations

On for Rotations turns both motors on, waits until one of them has turned for the number of rotations in
the Rotationsinput, then turns both motors off. This can be used to make your robot travel a specific
distance or turn a specific amount.
You can control the speed and direction of your robot using the Power and Steering inputs. Use Brake at
End to stop your robot after exactly the specified number of motor rotations.
Inputs used: Power, Steering, Rotations, Brake at End

Tips and Tricks


If the Steering input is not zero, one of the motors will be slowed down or reversed to make the robot
turn. In this case, the Rotations input will be measured on the motor that is turning faster.
Example

This program will make a robot drive straight forward at 50% power until the motors have turned 3 full
rotations. It will then drive straight backwards (using a negative number for Power) for 3 rotations and
stop where it started.

Tips and Tricks


The On for Rotations mode is exactly the same as the On for Degrees mode, but it uses a different unit of
rotation. You can also use a decimal point in the Rotations input to get parts of a rotation. The following
examples show two different ways to get the same amount of rotation:

Rotations
1

Degrees
360

720

0.5

180

1.25

450

7.2

2592

MOTOR POWER AND DIRECTION


The Power input accepts a number from -100 to 100. Positive and negative numbers for Power make the
Large Motor turn in different directions, as shown in the graphic below.

Positive Power
Negative Power
You can change the normal rotation direction for a motor using the Invert Motor block. If a motor
direction has been inverted, the effect of positive and negative power levels will be the opposite of that
shown above.

Tips and Tricks


The rotation speed of a motor will be roughly proportional to the power level specified, although rotation
speed is also affected by how much load is put on the motor.

STEERING AND MOTOR SPEED


The Steering input accepts a number from -100 to 100. A value of 0 (zero) will make your robot drive
straight. A positive number (greater than zero) will make your robot turn to the right, and a negative
number will make your robot turn to the left. The farther the steering value is from zero, the tighter the
turn will be.
The Move Steering block makes your robot turn by running the two motors at different speeds. For very
tight turns, one of the motors will be reversed.

Tips and Tricks

To directly control the power level used by both motors, you can use the Move Tank block instead of the
Move Steering block.

INPUTS

The inputs of the Move Steering block control the details of how the motors will operate. You can enter
the input values directly into the block. Alternatively, the values can be supplied by Data Wires from the
outputs of other Programming Blocks. The inputs available and their functions depend on the control
mode you selected.

Input

Power

Type

Numeri
c

Allowed
Values
-100 to 100

Notes

Motor power level.


See Motor Power and Direction.

Steering

Numeri
c

-100 to 100

Steering direction.
See Steering and Motor Speed.

Brake at
End

Logic

True/False

Applies when the block finishes.


If True, the motors are stopped immediately and held
in position.
If False, motor power stops and the motors are
allowed to coast.

Seconds

Numeri
c

Movement time in seconds.

Degrees

Numeri
c

Any Number

Amount of movement amount in degrees. 360


degrees make a full rotation.

Rotations

Numeri
c

Any Number

Amount of movement in rotations.

Move Tank Block


The Move Tank block can make a robot drive forward, backward, turn, or
stop. Use the Move Tank block for robot vehicles that have two Large Motors,
with one motor driving the left side of the vehicle and the other the right side.
You can make the two motors go at different speeds or in different directions
to make your robot turn.

Left motor
Right motor

Tips and Tricks


Robot vehicles with two drive motors can also be controlled by the Move Steering block. The Move
Steering block is similar to the Move Tank block, but has a different way of controlling turns.

CHOOSE YOUR MOTOR PORTS AND CONTROL MODE

Port Selector
Mode Selector
Inputs
Select the two motors (A, B, C, or D) that you want the Move Tank block to control by using the Port
Selector on the top of the block. Click on each motor letter to choose the port for that motor. The first
port should be the motor on the left side of the vehicle, and the second port should be the motor on the

right side.

Tips and Tricks


Make sure that with your robot facing forward, the motor on the left side is the first one listed in the
Port Selector. Otherwise, your robot will turn in the wrong direction.
Use the Mode Selector to select how you want to control the motors. After selecting the mode, you can
choose values for the inputs. The inputs available will change depending on the mode. The modes and
inputs are described below.
Modes: On, Off, On for Seconds, On for Degrees, On for Rotations

MODES
On

The On mode turns both motors on, then immediately continues to the next block in the program. You
can control the speed and direction of the motors using the Power Left and Power Right inputs. The
motors will run until they are stopped or changed by another block later in the program, or until the
program ends.
Inputs used: Power Left, Power Right
Example

Use the On mode when you want other blocks in your program to control how long the motors stay on. In
this program the robot drives straight forward. When the touch sensor is pressed the robot stops.
Off

The Off mode turns both motors off. Use the Off mode to stop a robot that was started by the On mode
earlier in the program. See the example above.
If Brake at End is True, the motors are stopped immediately. The motors will be held in their stopped
position until another Move or Motor block starts them, or until the program ends. If Brake at End is
False, power to the motors is simply turned off. The motors will coast using any remaining momentum
until they stop, or until another Move or Motor block starts.
Inputs used: Brake at End
On For Seconds

On for Seconds turns both motors on for the number of seconds in the Seconds input, then turns them
off. The block will wait until the time has passed before the program will continue to the next block.
You can control the speed and direction of your robot using the Power Left and Power Right inputs.
Use Brake at Endto stop your robot after exactly the specified number of seconds.
Inputs used: Power Left, Power Right, Seconds, Brake at End
Example

This program will make a robot drive straight forward at full power for 2 seconds, then stop.

Tips and Tricks

You can use a decimal point in the Seconds input to get an exact amount of time, such as 3.5 for three
and a half seconds, and 0.25 seconds for one quarter of a second.
On For Degrees

On for Degrees turns both motors on, waits until one of them has turned for the number of degrees of
rotation in the Degrees input, and then turns both motors off. This can be used to make your robot travel
a specific distance or turn a specific amount. 360 degrees of rotation corresponds to one full turn of a
motor.
You can control the speed and direction of your robot using the Power Left and Power Right inputs.
Use Brake at Endto stop your robot after exactly the specified number of seconds.
Inputs used: Power Left, Power Right, Degrees, Brake at End
Example 1

This program will make a robot drive straight forward at 75% power until the motors have turned 900
degrees (two and a half rotations), then stop. Using the same value for Power Left and Power
Right makes the robot drive straight.

Tips and Tricks


The distance that your robot will travel depends on the Degrees input. However, the distance also
depends on the diameter of the drive wheels used and other physical factors. The internal rotation

sensors in the motors measure the amount of rotation at the motor hubs.
Example 2

The program below will make a robot turn in an arc to the right, because Power Left is greater
than Power Right. The turn will continue until the left motor (the outside and faster one) has turned
exactly 900 degrees, then the robot will stop.

Example 3

This program will make a robot do a spin turn by making the two motors turn in different directions.
Using a negative number for Power Right makes the right motor turn backwards. The robot will turn until
the left motor has turned 250 degrees forward, then the robot will stop. The right motor will turn 250
degrees backwards.

Tips and Tricks

Note that the Degrees input measures the amount of motor rotation of the forward or faster motor, not
the change in the robots direction when turning. The change in the robots direction will depend on wheel
diameter, wheel spacing, and other factors.
On For Rotations

On for Rotations turns both motors on, waits until one of them has turned for the number of rotations in
the Rotationsinput, then turns both motors off. This can be used to make your robot travel a specific
distance or turn a specific amount.
You can control the speed and direction of your robot using the Power Left and Power Right inputs.
Use Brake at Endto stop your robot after exactly the specified number of seconds.
Inputs used: Power Left, Power Right, Rotations, Brake at End
Example

This program will make a robot drive straight forward at 50% power (using 50 for both Power
Left and Power Right) until the motors have turned 3 full rotations. It will then drive straight backwards

(using negative power) for 3 rotations and stop where it started.

Tips and Tricks


The On for Rotations mode is exactly the same as the On for Degrees mode, but it uses a different unit of
rotation. You can also use a decimal point in the Rotations input to get parts of a rotation. The following
examples show two different ways to get the same amount of rotation:

Rotations

Degrees

360

720

0.5

180

1.25

450

7.2

2592

MOTOR POWER AND DIRECTION


The Power Left and Power Right inputs accept a number from -100 to 100. Positive and negative numbers
make the Large Motor turn in different directions, as shown in the graphic below.

Positive Power
Negative Power
You can change the normal rotation direction for a motor using the Invert Motor block. If a motor
direction has been inverted, the effect of positive and negative power levels will be the opposite of that
shown above.

Tips and Tricks


The rotation speed of a motor will be roughly proportional to the power level specified, although rotation
speed is also affected by how much load is put on the motor.

INPUTS
The inputs of the Move Tank block control the details of how the motors will operate. You can enter the
input values directly into the block. Alternatively, the values can be supplied by Data Wires from the
outputs of other Programming Blocks. The inputs available and their functions depend on the control
mode you selected.

Input

Type

Allowed
Values

Notes

Power Left

Numeric

-100 to 100

Motor power level for the left motor.


See Motor Power and Direction.

Power
Right

Numeric

-100 to 100

Motor power level for the right motor.


See Motor Power and Direction.

Brake at
End

Logic

True/False

Applies when the block finishes.


If True, the motors are stopped immediately and
held in position.
If False, motor power stops and the motors are
allowed to coast.

Seconds

Numeric

Movement time in seconds.

Degrees

Numeric

Any Number

Amount of movement amount in degrees. 360


degrees make a full rotation.

Rotations

Numeric

Any Number

Amount of movement in rotations.

Display Block
The Display block can display text or graphics on the EV3 Brick display.

CHOOSE THE DISPLAY MODE

Mode Selector
Block Text Field
Inputs
Display Preview button
Select the type of text or graphics you want to display using the Mode Selector. After you have selected
the mode, you can choose values for the inputs. The inputs available will change depending on the mode.
The modes and inputs are described below.
You can click the Display Preview button to see a preview of what the Display block will show on the EV3
Display. You can keep the preview open while you are choosing the input values for the block.
Modes: Text Pixels, Text Grid, Shapes Line, Shapes Circle, Shapes Rectangle, Shapes
Point, Image, Reset Screen

DISPLAY COORDINATES
Many of the Display block modes use X and Y coordinates to specify where to draw an item. The
coordinates specify a pixel position on the EV3 Brick display. The position (0, 0) is at the upper left corner
of the display, as shown in the image below.

The display is 178 pixels wide and 128 pixels high. X coordinate values range from 0 at the left of the
display to 177 at the right. Y coordinate values range from 0 at the top to 127 at the bottom.

Tips and Tricks

You can use the Display Preview button in the top left corner of the Display block to help you find the
right display coordinates.

MODES
Text Pixels

The Text Pixels mode can display text at any location on the EV3 Brick display.
If Clear Screen is True, the display will be cleared before the text is drawn.
The Text input is at the top of the block. It contains the text string to display. Choose Wired to show
a Text input that can accept a Data Wire. The text can include any characters in the Supported
Text character set.
The X and Y inputs specify the Display Coordinates of the starting point of the text, which is the upperleft corner of the displayed text.
Use the Color Input to choose the color of the text. If you choose Black, the text will display in black on a
white background. If you choose White, the text will display in white on a black background.
You can use the Font input to choose from three different typefaces: Normal, Bold, and Large.
Inputs used: Clear Screen, Text, X, Y, Color, Font
Example

This program displays Hello! in the center of the display using the Large font.
Text Grid

The Text Grid mode displays text aligned to a grid of rows and columns. This makes it easy to display
and align multiple lines of text. The height of a row is enough space to display a line of text in the Normal
or Bold fonts, and each character in these fonts is one column wide.
If Clear Screen is True, the display will be cleared before the text is drawn.
The Text input is at the top of the block. It contains the text string to display. Choose Wired to show
a Text input that can accept a data wire. The text can include any characters in the Supported
Text character set.
The Column input specifies the starting column (horizontal position) for the text. Each column is 8 pixels
wide. The columns are numbered from 0 at the left to 21 at the right.
The Row input specifies the row or line number (vertical position) for the text. Each row is 10 pixels
high. Row 0 is at the top of the display, and row 11 is near the bottom of the display.
Inputs used: Clear Screen, Text, Column, Row, Color, Font

Tips and Tricks


The width of a column is the same as the width of a character in the Normal and Bold fonts, so adding 1
to Columnwill start the text one character to the right when using these fonts. Characters in the Large
font are twice as wide and twice as tall as the Normal font, so each character occupies two columns and
two rows.
Use the Color input to choose the color of the text. If you choose Black, the text will display in black on a
white background. If you choose White, the text will display in white on a black background.
You can use the Font input to choose from three different typefaces: Normal, Bold, and Large.
Inputs used: Clear Screen, Text, Column, Row, Color, Font
Example

This program displays two lines of text. The second Display Block uses False for the Clear Screen input to
add the second line without erasing the first line.

Tips and Tricks

When displaying multiple lines of text in the Large font, add 2 to the Row input between each line to keep
the lines from overlapping.
Shapes Line
The Shapes Line mode draws a straight line between any two points on the display.
If Clear Screen is True, the display will be cleared before the line is drawn.
The X1 and Y1 inputs specify the Display Coordinates of the first point in the line.
The X2 and Y2 inputs specify the coordinates of the second point.
You can use the Color input to choose either a black or white line. A white line will only be visible if Clear
Screen is False and the line draws over an area where a previous Display Block displayed something
black.
Inputs used: Clear Screen, X1, Y1, X2, Y2, Color
Example

This program will draw a diagonal line across the EV3 Brick display.
Shapes Circle

The Shapes Circle mode draws a circle on the display.


If Clear Screen is True, the display will be cleared before the circle is drawn.
The X and Y inputs specify the Display Coordinates of the center of the circle. The Radius input specifies
the radius of the circle in pixels.
If Fill is True, the interior of the circle will be filled. If Fill is False, only the outline of the circle is drawn.
You can use the Color input to choose either a black or white circle. A white circle will only be visible
if Clear Screen is False and the circle draws over an area where a previous Display block displayed
something black.
Inputs used: Clear Screen, X, Y, Radius, Fill, Color
Example

This program continuously displays a filled circle whose radius is the Ambient Light Intensity value from
the Color Sensor. The display is updated every tenth of a second.
Shapes Rectangle

The Shapes Rectangle mode draws a rectangle on the display.


If Clear Screen is True, the display will be cleared before the rectangle is drawn.
The X and Y inputs specify the Display Coordinates of the upper left corner of the rectangle.
The Width and Heightinputs specify the size of the rectangle in pixels.
If Fill is True, the interior of the rectangle will be filled. If Fill is False, only the outline of the rectangle is
drawn.
You can use the Color input to choose either a black or white rectangle. A white rectangle will only be
visible if Clear Screen is False and a previous Display Block displayed something black in the same area of
the display.
Inputs used: Clear Screen, X, Y, Width, Height, Fill, Color
Example

This program fills the entire display with black by using a large filled rectangle. It then draws a smaller,
outlined white rectangle on top of it.

Tips and Tricks


You can use a filled white rectangle to clear part of the display without affecting other parts of the
display.
Shapes Point

The Shapes Point mode draws a single pixel on the display.


If Clear Screen is True, the display will be cleared before the pixel is drawn.
The X and Y inputs specify the Display Coordinates of the pixel to draw.
You can use the Color input to choose to draw the pixel in either black or white. Drawing in white can be
used to clear black pixels drawn by previous Display blocks.
Inputs used: Clear Screen, X, Y, Color
Image

The Image mode draws a graphic image file.


The File Name input is at the top of the block. It lets you choose from a list of image files. The images in
the LEGO Images category are the image files that are included with the EV3 Software. The images
listed in the Project Images category are the images that have already been used in your project. This
makes it easy to use the same image multiple times in a program or project.
If Clear Screen is True, the display will be cleared before the image is drawn.
The X and Y inputs specify the Display Coordinates for the upper left corner of the image. The image will
be drawn below and to the right of this point, using as much space as necessary to draw the entire
image. For image files that are sized to fill the entire display, use X = 0 and Y = 0.
Inputs used: Clear Screen, File Name, X, Y
Reset Screen

The Reset Screen mode returns the EV3 Brick display to the normal screen of information shown when a
program is running. This screen shows the name of the program and other feedback. When you run a
program on the EV3 Brick, this screen is shown until the first Display block in the program executes.

KEEPING DISPLAYED ITEMS VISIBLE

When an EV3 program ends, the display on the EV3 Brick is cleared and returned to the EV3 Brick menu
display. This will erase any text or graphics that were displayed by the program. If, for example, your
program contains a single Display block with nothing after it, the display will be cleared so quickly when
the program ends that you will not get a chance to see the results of your Display block.
If you want to keep a display showing at the end of the program, you will need to add a block to the end
of the program to keep the program from ending right away, as shown in the following examples.
Example 1

This program uses a Wait block to put a 3-second delay at the end of the program. This will keep the
circle displayed for 3 seconds before the display is cleared at the end of the program.
Example 2

This program uses a Loop at the end of the program to keep the program running forever. This will keep
the circle displayed until you stop the program by pressing the Back button on the EV3 Brick.

DISPLAYING MULTIPLE ITEMS


If you want to display multiple text or graphic items on the display at the same time, it is important to
not clear the EV3 Brick display between items. Every Display block mode has a Clear Screen input.
If Clear Screen is True, the entire display will be cleared before the item is displayed. This means that to
display multiple items you must set Clear Screen to False for every Display block except the first one.
See the programming examples in the Text Grid and Shapes Rectangle modes.

DISPLAYING NUMBERS
You can display the value of a number in your program by connecting a Data Wire to the Text input of a
Display Text block. A Numeric data wire will be automatically converted to Text by a Data Wire type
conversion (see Data Wires for more information).

Tips and Tricks


Choose Wired from the Text input at the top of the block to show the Text input that can accept a data
wire.
Example

This program continuously displays the Reflected Light Intensity value from the Color Sensor on the
display, updating the display every quarter of a second.

INPUTS
The inputs of the Display block specify the text or graphics to display and how it is displayed. You can
enter the input values directly into the block. Alternatively, the values can be supplied by Data Wires from
the outputs of other Programming Blocks.

Input

Type

Allowed Values

Notes

Clear
Screen

Logic

True/False

If True, the display is cleared before the


item is drawn.

File
Name

Text

Name of an existing
Image file

See the Image Editor for details.


Choose Wired from the File Name input
on the top of the block to show the File
Name input for a data wire.

Text

Text

Characters from
theSupported
Text character set.

Text to display.
Choose Wired from the Text input on the
top of the block to show the Text input for a
data wire.

Column

Numeri
c

0 to 21

Horizontal starting column.


Columns are 8 pixels wide.
Column 0 is at the left of the display.

Row

Numeri
c

0 to 11

Vertical text row or line number


Rows are 10 pixels high.
Line 0 is at the top of the display.

Numeri
c

0 to 177

X coordinate 0 is at the left of the display.

Numeri
c

0 to 127

Y coordinate 0 is at the bottom of the


display.

X1

Numeri
c

0 to 177

X coordinate of the first point in a line

Y1

Numeri
c

0 to 127

Y coordinate of the first point in a line

X2

Numeri
c

0 to 177

X coordinate of the second point in a line

Y2

Numeri
c

0 to 127

Y coordinate of the second point in a line

Radius

Numeri
c

Radius of a circle in pixels

Width

Numeri
c

Width of a rectangle in pixels

Height

Numeri
c

Height of a rectangle in pixels

Fill

Logic

True/False

If True, the interior of a shape is filled

Color

Logic

False = Black
True = White

Drawing text in White puts a black


background around the characters.
Drawing shapes in White clears black pixels
on the display.

Font

Numeri
c

0 = Normal
1 = Bold
2 = Large

Normal font is 9 pixels high by 8 wide.


Bold font is 8 pixels high by 8 wide.
Large font is 16 pixels high by 16 wide.

Sound Block
The Sound block makes sound using the speaker inside the EV3 Brick. You
can play pre-recorded sound files or specify a musical note or tone.

CHOOSE THE SOUND MODE

Mode Selector
File Name input
Inputs
Select which kind of sound you want to make using the Mode Selector. After you have selected the mode,
you can choose values for the inputs. The inputs available will change depending on the mode. The
modes and inputs are described below.
Modes: Play File, Play Tone, Play Note, Stop

MODES
Play File
The Play File mode plays a pre-recorded sound file.
The File Name input is at the top of the block. It lets you choose from a list of sound effects, spoken
words and phrases. The sounds in the LEGO Sounds category are the sound files that are included with
the EV3 Software. The sounds listed in the Project Sounds category are the sounds that have already
been used in your project. This makes it easy to use the same sound multiple times in a program or
project.
If you choose Wired from the File Name input on the top of the block, a File Name input appears in the
inputs area of the Sound block. This allows you to supply the name of the sound file with a Data Wire.

Note that you need to add the sound file to your Project first by selecting it in the File Name input.
The Volume input controls how loud the sound will be.
The Play Type input controls whether the block will wait for the sound to finish before the program
continues to the next block, and whether the sound will repeat.
Inputs used: File Name, Volume, Play Type
Example 1

This program will make the EV3 Brick say Turn Right by playing two different sound files and waiting for
each to complete.

Tips and Tricks

The EV3 Brick can only play spoken word sounds that are stored in pre-recorded sound files. The text in
the File Name input must be the name of an existing sound file.
Example 2

This program will make a continuous laughing sound at the same time as driving the robot forward for 10
seconds. It does this by using Repeat for the Play Type input.
Play Tone

The Play Tone mode plays a tone of a specified frequency. The frequency of the tone controls the pitch, in
other words, how high or low the sound is.
The Frequency input specifies the frequency of the tone in Hz (cycles per second). You can type a number
for the frequency or choose a frequency from the list of standard musical note frequencies.
The Duration input controls how long the tone will last, in seconds.
Inputs used: Frequency, Duration, Volume, Play Type

Tips and Tricks


The tones played by the Play Tone mode sound the same as the musical notes played by the Play
Note mode, but you can specify an exact frequency using Play Tone.
The Volume input controls how loud the sound will be.
The Play Type input controls whether the block will wait for the sound to finish before the program
continues to the next block, and whether the sound will repeat.
Inputs used: Frequency, Duration, Volume, Play Type

Example

This program will make a tone vary in frequency, based on the position of a motor rotation sensor. When
you turn the motor by hand, the tone will change.
Play Note

The Play Note mode plays a musical note.


The Note input lets you choose the note from a piano keyboard control.
The Duration input controls how long the note will last in seconds.
Inputs used: Note, Duration, Volume, Play Type

Tips and Tricks


You can use a decimal point in the Duration input to get an exact amount of time, including very short
intervals. For example, 0.1 seconds will play the note for one tenth of a second.
The Volume input controls how loud the sound will be.
The Play Type input controls whether the block will wait for the sound to finish before the program
continues to the next block, and whether the sound will repeat.
Inputs used: Note, Duration, Volume, Play Type
Example

This program will play a short tune by playing three different notes.
Stop

The Stop mode stops any sound that is currently being played by the EV3 Brick. This is usually used to
stop a sound that was started earlier in the program by a Sound Block that didnt wait for the sound to
complete.
Example

This program will play a tone until a touch sensor is pressed and then stop the tone.

INPUTS
The inputs of the Sound block control the details of the sound that is played. You can enter the input
values directly into the block. Alternatively, the values can be supplied by Data Wires from the outputs of
other Programming Blocks.

Input

Type

Allowed Values

Notes

File
Name

Text

Name of an existing
sound file

For example, Laughing 2

Note

Text

C through B,
followed optionally by
#, followed by 4
through 6.

A-G is a musical note name.


4-6 is an octave number.
# means sharp.
Examples: C4 is middle C on a
standard piano, and C#4 is one half
step higher.

Frequenc
y

Number

300 to 10000

Tone frequency in Hz

Duration

Number

Duration of note or tone in seconds

Volume

Number

0 to 100

A percentage of full volume

Play Type

Number

0, 1, or 2

0 = Wait for Completion: The sound


plays once, and the program waits for the
sound to finish before continuing.
1 = Play Once: The sound plays once, and
the program continues immediately.
2 = Repeat: The sound will be repeated
continuously until another Sound Block
is executed, and the program continues
immediately.

A-G
C

Do,R,Mi
Do

Mi

Fa

Sol

La

Si

Brick Status Light Block


The Brick Status Light block controls the Brick Status Light. The Brick Status
Light surrounds the brick buttons on the face of the EV3 Brick. You can turn
the Brick Status Light on in green, orange, or red, turn it off, or make it pulse
on and off.

CHOOSE THE CONTROL MODE

Mode Selector
Inputs
Use the Mode Selector to choose how you want to control the Brick Status Light. If you select the On
mode, you can choose the color and the pulse option using the Inputs. The modes and inputs are
described below.
Modes: On, Off, Reset

MODES
On

The On mode turns the Brick Status Light on.


You can choose the color of the light using the Color input.
If Pulse is True, the light will pulse on and off in a repeating pattern.
After using the On mode, the light will stay on or pulse until another Brick Status Light block is executed,
or until the program ends.
Inputs used: Color, Pulse
Example

This program makes the Brick Status Light pulse orange while the robot is driving backwards, then turns
the light off.
Off

The Off mode turns the Brick Status Light off.


Reset

The Reset mode returns the Brick Status Light to the standard green blinking pattern that indicates a
program is running on the EV3 Brick.

Tips and Tricks

The standard green blinking pattern is different than the result of using the Pulse option.

INPUTS
In the On mode, the inputs of the Brick Status Light block control how the Brick Status Light will function.
You can enter the input values directly into the block. Alternatively, the values can be supplied by Data
Wires from the outputs of other Programming Blocks.

Input

Type

Allowed
Values

Notes

Color

Numeric

0, 1, or 2

0 = Green
1 = Orange
2 = Red

Pulse

Logic

True/False

If True, the light will pulse on and off in a repeating


pattern.
If False, the light will stay on constantly.

Start Block
The Start block marks the beginning of a programming block sequence in
your program. Your program can have more than one sequence. All sequences
with a Start block will start automatically when a program is run, and the
sequences will run at the same time.

Tips and Tricks


If a sequence of programming blocks does not start with a Start block, the blocks will not run.
If your robot is turned on and connected to your computer (by USB, Bluetooth, or Wi-Fi), you can also
click on the green arrow on the Start block to immediately run that single sequence in your program.

Tips and Tricks

Clicking on the green arrow on the Start block will compile and download the entire program to your EV3,
but only the selected sequence will run.
Example 1: Starting a Single Sequence

This program has a single block sequence starting with a Start block.
There are three different ways to run this program on your EV3 Brick:
1. Click the Download button in the software, then select and run the program on the EV3 Brick.
2. Click the Download/Run button in the software. The program will download and then run
immediately.
3. Click the green arrow on the Start block. The program will download, and the sequence will run
immediately.
Example 2: Two Block Sequences

This program uses two different block sequences to make two different kinds of actions happen at the
same time. In the first sequence, a Loop makes the EV3 alternate between two sounds and two images.
In the second sequence, a Medium Motor alternates between running for second and stopping for
second.
If you click the green button on either Start block in the program above, you can see what that sequence
in the program does. When you run the whole program from the EV3 Brick, you can see the two
sequences happening at the same time.

Tips and Tricks

The Wait block in the second sequence of Example 2 will cause only the second sequence to wait for the
time to pass. The first sequence is not affected and keeps running.

Wait Block
The Wait block makes your program wait for something before continuing to
the next block in the sequence. You can wait for a certain amount of time, for
a sensor to reach a certain value, or for a sensor value to change.

Tips and Tricks


The Wait block does not make your robot stop. If any motors are on at the beginning of the block, they
will stay on during the wait.

CHOOSE THE WAIT MODE

Mode Selector
Inputs
Use the Mode Selector to select a Wait mode. Choose the Time mode to wait for a specified amount of
time in seconds. Choose a sensor type and a Compare mode to wait for the sensor to reach a certain
value. Choose a sensor type and a Change mode to wait for the sensor to change to a new value or by a
certain amount.
The Inputs available will change depending on the mode.
Modes: Time, Sensor Compare Modes, Sensor Change Modes
Time

In the Time mode, the Wait block waits for the amount of time you specify in the Seconds input. The time
is measured from the start of the Wait block.

Tips and Tricks

You can include a decimal point in Seconds. For example, 2.5 seconds would wait for two and a half
seconds.
See programming examples in the Display block Keeping Displayed Items Visible section.

SENSOR COMPARE MODES

Each of the sensor types listed in the Wait block has one or more Compare modes. A Compare mode will
continuously read data from the sensor and wait for it to reach a value that you specify.
Some types of sensor data can be compared to a Threshold Value, and other types can be compared to
certain specific values.

WAITING FOR A SENSOR THRESHOLD VALUE

In a sensor Compare mode with a Threshold Value input, the Wait block will continuously read Numeric
data from the sensor and compare it to a Threshold Value that you specify. The block stops waiting when
the threshold comparison is True. For example, you could wait until the Color Sensor detects a Reflected
Light Intensity value that is less than 50.

Mode Selector
Port Selector
Compare Type input
Threshold Value input
Measured Value output
Use the Mode Selector to choose a sensor Compare mode with a Threshold Value input. If the mode uses
a port, use the Port Selector to make sure that the port matches the port on the EV3 Brick that the
sensor or motor is connected to.
Choose the type of comparison you want to use from the Compare Type list, and enter the Threshold
Value. The Wait block will wait until the threshold comparison is True.

Tips and Tricks


If the specified comparison is already True at the beginning of the Wait block, the program will
immediately continue to the next block.
The final sensor value is output in Measured Value. You could use this to determine the exact sensor data

value that made the threshold test True.


For more information on using the different sensor types and what data they provide, see the Using
Sensors help articles.
See Programing Example: Drive until a Black Line is Reached (Method 2) in Using the Color Sensor.

WAITING FOR SPECIFIC SENSOR VALUES


The following Compare modes of the Wait block allow you to wait for specific sensor values:
Brick Buttons Compare Brick Buttons
Color Sensor Compare Color
Infrared Sensor Compare Remote
Touch Sensor Compare State
Ultrasonic Sensor Compare Presence
Messaging Compare Modes
Brick Buttons Compare Brick Buttons

You can wait for one or more of the Brick Buttons to be Pressed, Released, or Bumped. For example, you
could wait for the Center button to be Pressed. See Using the Brick Buttons for more information about
the Brick Buttons.
Select one or more Brick Buttons in the input Set of Brick Button IDs and select Released, Pressed, or
Bumped as the Action. The Wait block will wait until any one of the selected buttons to do the selected
action. The Measured Valueoutput indicates which button (if any) is pressed at the end.
Example

This program makes a robot drive forward until the Center button is pressed, then it stops and makes a
sound.
Color Sensor Compare - Color

You can wait for the Color Sensor to detect one or more specified colors. For example, you could wait for
the Color Sensor to detect black. See Using the Color Sensor for more information about the Color Sensor
in Color mode.
Select one or more colors in the Set of Colors input. The block will wait until any one of the selected
colors is detected. The detected color is output in Measured Value.
See Programming Example: Drive until a Black Line is Reached (Method 1) in Using the Color Sensor
Infrared Sensor Compare - Remote

You can wait for a button to be pressed on the IR Beacon. See Using the Infrared Sensor Remote
Mode for more information about the Infrared Sensor.
Select one or more buttons in the Set of Remote Button IDs and enter the Channel number for the IR
Beacon. The block will wait until any one of the selected buttons is pressed. The ID of the button pressed
is output in Measured Value.
Example

This program makes a motor start turning when Button 1 on the IR Beacon is pressed, then stop turning
when the button is released. The release is detected by waiting for no button to be pressed (Button ID =
0).
Touch Sensor Compare - State

You can wait for a Touch Sensor to be Pressed, Released, or Bumped. See Using the Touch Sensor for
more information.
Select Released, Pressed, or Bumped in the State input. The block will wait for the touch sensor to be in
the selected state.
See Programming Example: Drive until a Touch Sensor is Pressed in Using the Touch Sensor
Ultrasonic Sensor Compare - Presence

You can wait for the Ultrasonic Sensor to detect a signal from another Ultrasonic Sensor nearby. The
block will wait until an ultrasonic signal is detected. See Using the Ultrasonic Sensor for more information.
Messaging Compare Modes

You can wait for a message to be received that matches a specified comparison. See Messaging for more
information.

SENSOR CHANGE MODES


Change

Each of the sensor types listed in the Wait block has one or more Change modes. A Change mode will
continuously read data from the sensor and wait for it to change to a different value, or change by an
amount that you specify.
You can wait for some types of sensor data to change by a certain Amount, and other types to change to
a different value.

WAITING FOR A SENSOR TO CHANGE BY A CERTAIN AMOUNT

In a sensor Change mode with an Amount input, the Wait block will read a starting value from the sensor
at the start of the block, then continuously read data from the sensor and wait for the value to change by
the specified Amountfrom the starting value. You can choose the Direction of change that is required
(Increase, Decrease, or Any). For example, you could wait for the Ambient Light Intensity value from the
Color Sensor to increase by 10.

Mode Selector
Port Selector
Direction input
Amount input
Measured Value output
Use the Mode Selector to choose a sensor Change mode with an Amount input. If the mode uses a port,
use the Port Selector to make sure that the port matches the port on the EV3 Brick that the sensor or
motor is connected to.
Choose the type of direction of change you want to wait for in the Direction (Increase, Decrease, or Any),
and enter the change Amount. Choosing Any for the Direction will make the block wait for the sensor
value to either increase or decrease by the specified amount.
The final sensor value is output in Measured Value.
Example

This program waits for the Ambient Light Intensity value from the Color Sensor to increase by 10 before
driving. You could use this to make your robot start driving when you turn the room lights on or shine a
flashlight at the sensor.

WAITING FOR A SENSOR TO CHANGE TO ANY DIFFERENT VALUE


The following Change modes of the Wait block allow you to wait for a sensor to change to any value that
is different than the value at the start of the block:
Brick Buttons Change Brick Buttons
Color Sensor Change Color
Infrared Sensor Change Remote
Touch Sensor Change State
Messaging Change Modes
Brick Buttons Change Brick Buttons

The Brick Buttons Change Brick Buttons mode waits for any one of the Brick Buttons to be pressed or
released. The Button ID of the button that was pressed or released is output in Button Changed.
See Using the Brick Buttons for more information about the Brick Buttons.
See Programming Example: Press a Button to Continue in Using the Brick Buttons
Color Sensor Change Color

The Color Sensor Change Color mode waits for the color number detected by the Color Sensor in
Color mode (0-7) to change. The ending color detected is output in Color. See Using the Color Sensor for
more information about using the Color Sensor in Color mode.
Infrared Sensor Change - Remote

The Infrared Sensor Change - Remote mode waits for the Button ID from the IR Beacon to change. In
most cases, the Button ID will change if any button on the IR Beacon is pressed or released. The Button
ID measured after the change is output in Measured Value. See Using the Infrared Sensor Remote
Mode for more information.
See Programming Example: Remote Start Button in Using the Infrared Sensor Remote Mode

Touch Sensor Change - State

The Touch Sensor Change - State mode waits for the state of the touch sensor to change. If the sensor
is Released (not pressed) at the start of the block, it will wait for it to be Pressed. If the sensor is Pressed
at the start of the block, it will wait for to be Released. The ending state is output in Measured Value.
See Using the Touch Sensor for more information.
Messaging Change Modes

The Messaging Change modes wait for a message of the specified type and Message Title to be received
with a value that is different from the last matching message type.
The Messaging Update modes wait for a message of the matching type (Text, Numeric, or Logic) and
Message Title to be received. The message value is output in Message

INPUTS AND OUTPUTS


The inputs available for the Wait block will depend on the mode selected. You can enter the input values
directly into the block. Alternatively, the input values can be supplied by Data Wires from the outputs of
other Programming Blocks.

Input

Type

Notes

Seconds

Numeric

Number of seconds to wait in Time mode.

Compare Type

Numeric

Comparison type for a Sensor Compare Mode with a


Threshold Value.
0: = (Equal)
1: (Not Equal)
2: > (Greater Than)
3: (Greater Than or Equal To)
4: < (Less Than)
5: (Less Than or Equal To)

Threshold Value

Numeric

Value to compare sensor data to for a Sensor Compare


Mode with a Threshold Value.

Direction

Numeric

Direction for a Numeric sensor value to change.


Used in Sensor Change Modes that have an Amount
input.
0 = Increase

1 = Decrease
2 = Any
Amount

Numeric

(Inputs for individual


sensor types)

Amount for sensor value to change in a Sensor Change


Mode
See the help on the individual sensor types for more
information on the sensor data.

The output of the Wait block is the sensor value measured at the end of the wait, for a Sensor Compare
or Sensor Change mode. To use the output, use a Data Wire to connect it to a Programming Block inside
or after the loop.

Output

Type

(Outputs vary for


sensor types)
Measured Value

Notes
See the help mode on the individual sensor types for more
information on the sensor data.

Numeric

The sensor value after the wait.

Loop Block
The Loop block is a container that can hold a sequence of programming
blocks. It will make the sequence of blocks inside it repeat. You can choose to
repeat the blocks forever, a certain number of times, or until a sensor test or
other condition is True.

Tips and Tricks

Only the blocks inside the loop will repeat. After the loop ends, the program
will continue with the blocks that are after the loop.

Drag blocks to move them inside a loop. The Loop block will expand to make room for the blocks inside.

CHOOSE THE LOOP MODE

Mode Selector
Inputs
Count output
Loop Name
Use the Mode Selector to control how the loop will repeat. The different modes specify what condition will
make the loop end. For example, you can make the loop repeat a certain number of times, repeat until a
sensor data value reaches a certain threshold, or repeat forever. The Inputs available will change
depending on the mode. The modes are described below.

You can enter a name for the loop in the Loop Name field on the top of the Loop block. This name is used
by the Loop Interrupt block to give you another way to end the loop.
Blocks inside the loop can use the Count output to tell how many times the loop has repeated. See Using
the Count Output for more information.
Modes: Unlimited, Count, Time, Logic, Sensor Modes

MODES
Unlimited

In the Unlimited mode, the blocks inside the loop are repeated forever. Any blocks placed after the loop
will never be reached.
Example 1

This program makes a robot drive in an alternating straight/turn sequence, over and over, until the
program is stopped.

Tips and Tricks


Use the Back button on the EV3 to stop a program.
Example 2

This program will display a shut mouth on the EV3 display whenever the Touch Sensor is pressed, and an
open mouth otherwise. The loop makes the sensor test in the Switch block repeat continuously.
Count

In the Count mode, the Count input specifies how many times to repeat the blocks inside the loop.
Example

This program makes a robot say Hello once, then Go six times, then Bravo once. The Loop block

contains oneSound block and is configured to repeat six times.


Time

In the Time mode, you can specify an amount of time for the loop to repeat in the Seconds input. The
time is measured from the beginning of the loop.
The time limit is tested only at the end of the loop sequence. The loop sequence will always execute at
least once, and the loop will continue back to the beginning only if the elapsed time at that moment is
less than Seconds.
Logic

In the Logic mode, the loop will repeat until the Until input is True at the end of the loop sequence. The
loop sequence will always execute at least once, and the Until input is tested at the end of each loop
iteration.
Use a Data Wire to connect the Until input to a Logic output of a programming block inside the loop. This
output should be True when you want to loop to end.
Example

This program makes a robot drive forward until the Touch Sensor is pressed or the Color Sensor detects
black (whichever happens first). The output of a Logic Operations block is used for the Until input of the
loop. When the loop finishes, the robot is stopped.

Tips and Tricks

Many sensor tests involving only one sensor can be tested directly by the Loop block by using the Sensor
Modes described below.

SENSOR MODES
The Loop block contains several modes that read sensor data and compare it to an input value. There are
different modes for each sensor type. Some types of sensor data can be compared to a Threshold Value,
and other types can be compared to certain specific values.
Comparing Sensor Data to a Threshold Value
In a mode with a Threshold Value input, the Loop block will repeat the sequence of blocks inside the loop
until the threshold comparison is True. For example, you could make a loop repeat until the Color Sensor
detects a Reflected Light Intensity value that is less than a threshold value you specify.

Mode Selector
Port Selector
Compare Type input
Threshold Value input
Use the Mode Selector to choose a sensor mode with a Threshold Value input. If the mode uses a port,
use the Port Selector to make sure that the port matches the port on the EV3 Brick that the sensor or
motor is connected to.
Choose the type of comparison you want to use from the Compare Type list, and enter the Threshold
Value.
Each time the sequence of blocks inside the loop finishes, the Loop block will read the sensor data and

test the threshold. If the test is False at that moment, the loop will repeat. If the test is True, the loop will
end, and the program will continue with the next block after the loop.
For more information on using the different sensor types and what data they provide, see the Using
Sensors help articles.
Example

This program makes a robot drive forward while repeating three different sounds, until the Color Sensor
detects a Reflected Light Intensity of less than 50, then the robot is stopped.

Tips and Tricks


The sensor threshold is only tested at the end of the loop sequence. In the example above, if the Color
Sensor briefly passes over a dark color in the middle of the loop, the robot may not see it and not stop
Comparing Sensor Data to Specific Values
The following sensor modes allow a Loop to compare sensor data to specific input values. The loop will
repeat until the sensor data equals a specified input value.

Mode
Brick Buttons

Notes
Loop repeats until one of the selected buttons does the selected
action.
See Using the Brick Buttons.

Color Sensor - Color

Loop repeats until one of the selected colors is detected.


See Using the Color Sensor.

Infrared Sensor Remote

Loop repeats until one of the selected buttons on the IR Beacon is


pressed.
See Using the Infrared Sensor Remote Mode.

Touch Sensor

Loop repeats until the Touch Sensor is in the selected state.


See Using the Touch Sensor.

Ultrasonic Sensor
Presence

Loop repeats until an Ultrasonic signal is detected.


See Using the Ultrasonic Sensor.

Messaging

Loop repeats until the specified message type is received.

See Messaging Block.


Tips and Tricks
The sensor is only tested at the end of the loop sequence. If the sensor data matches the specified input
value only briefly while the loop sequence is executing, the loop may not stop.

USING THE COUNT OUTPUT


The Count output at the beginning of a Loop block tells you how many times the loop sequence has
executed. You can use the Count inside the loop to make the loop sequence do something different each
time the loop repeats.
The Count is 0 during the first time through the loop, and it increases by 1 each time the loop repeats.
Example

This program displays a count of the number of times the touch sensor has been bumped (pressed and
then released) on the EV3 Display. A Wait block inside the loop makes the loop wait for each touch sensor
bump before repeating, and the Count is used for the Text input of the Display block.

RESIZING A LOOP
The Loop block will usually expand automatically to make room for new programming blocks that you
drag into it. You can also resize a Loop block manually if you need to. To resize a loop, select the Loop
block, then drag the resize handles that appear around the outside.
Example

This Loop block is being resized to make room for a second sequence of blocks inside.

INPUTS AND OUTPUT


The inputs available for the Loop block will depend on the mode selected. You can enter the input values
directly into the block. Alternatively, the input values can be supplied by Data Wires from the outputs of

other Programming Blocks.

Input

Type

Notes

Count

Numeric

Number of times to repeat the loop in Count mode.

Seconds

Numeric

Number of seconds to repeat the loop in Time mode.

Until

Logic

In Logic mode, the loop will end when this input is


True.

Compare Type

Numeric

Comparison type for a Sensor Mode with a Threshold


Value.
0: = (Equal)
1: (Not Equal)
2: > (Greater Than)
3: (Greater Than or Equal To)
4: < (Less Than)
5: (Less Than or Equal To)

Threshold Value

Numeric

Value to compare sensor data to for a Sensor Mode with


a Threshold Value.

(Inputs for individual


sensor types)

See the help on the individual sensor types for more


information on the sensor data.

The output of the Loop block is the number of times the loop has repeated. To use the output, use a Data
Wire to connect it to a Programming Block inside or after the loop.

Output
Count

Type
Numeric

Notes
The number of times the loop has completed. The Count is 0 during the
first time through the loop.

Switch Block
The Switch block is a container that can contain two or more sequences of
programming blocks. Each sequence is called a Case. A test at the beginning
of the Switch determines which Case will run. Only one Case will run each
time the Switch is executed.

The Switch test shown here can decide which Case to run based on a sensor data value or a value from
a Data Wire. After one Case is selected and run, the program continues with any blocks after the Switch.

EXAMPLE
The program below makes a robot say Touch and then tests to see if the Touch Sensor is pressed. If so,
the True (top) Case executes, and the robot will display Thumbs up and say Yes. If the Touch Sensor
is not pressed, the False (bottom) Case executes, and robot will display Thumbs down and say No.
After the Switch, the robot will say Thank you.
Example

True Case
False Case
The Touch Sensor is tested as soon as the robot finishes saying Touch. If the sensor is being held down
at that instant, the Switch will run the True Case, otherwise it will run the False Case.

Tips and Tricks

A Switch does not wait for a sensor data value or data wire to reach a certain value. The test is run
as soon as the Switch block starts, and one of the Cases is chosen and run immediately after the
test.
In the program above, you can press the Touch Sensor before the test (or even before the program
starts) and hold it in during the test, to make sure the Switch executes the True Case. Try seeing
how long you can wait before pressing the sensor and still have the robot say Yes.
You can leave any Case in a Switch blank if you dont want the robot to do anything in that
situation. Try removing the two blocks from the False Case in the program above and see what
happens.
TABBED VIEW
A Switch can display in Flat view, as shown in the example above, or in Tabbed view, as shown below. In
Flat view, all of the Cases are visible in different rows. In Tabbed view, only one of the Cases is visible at
a time.
You can use Tabbed view to make your program take up less space on the screen. The view does not
affect the way the Switch executes.

Flat/Tabbed Selector
True Case
False Case
To toggle a Switch between the Flat and Tabbed views, click the Flat/Tabbed Selector.
To show a different Case inside a Switch in Tabbed view, click on the different tabs at the top of the
Switch border.

Tips and Tricks


Blocks in all of the Cases of a Tabbed Switch are a part of your program, even if you can only see some of
them at a time.

CHOOSE THE SWITCH TEST

Mode Selector
Port Selector
Inputs
Use the Mode Selector to select the type of test that the Switch will use to choose which Case to run. You
can test a sensor value or a Data Wire value.
If you select a mode that uses a port, use the Port Selector to make sure that the port matches the port
on the EV3 Brick that the sensor or motor is connected to.
The Inputs available will change depending on the mode. In some modes, you can compare a sensor
value to aThreshold Value, and in other modes you can test for specific sensor values. The modes are
described below.

TESTING A SENSOR THRESHOLD

The Switch block contains several modes that read a Numeric sensor data value and compare it to
a Threshold Valueto get a True or False result. For example, in the Color Sensor Compare Reflected
Light Intensity mode, you could test whether the Reflected Light Intensity from the Color Sensor is less
than 50.
In these modes, the Switch block contains two Cases. If the result of the test is True, the True Case will
execute, otherwise the False Case will execute.

Tips and Tricks

The True Case is the top Case in Flat view, marked by a checkmark. The False Case is the bottom Case,
marked by an X.
To use a mode with a sensor threshold, choose the Compare Type (for example, Less Than), and enter
the Threshold Value (for example, 50) to compare the sensor data to. The Switch block will take a single
sensor reading and compare it to the threshold to get a True or False result.
Example

In this program, the Switch block uses the Color Sensor Compare Reflected Light Intensity mode to
test whether the Reflected Light Intensity is less than 50. If so, it displays Low, otherwise it displays
High. The Switch is repeated in a Loop so that the display is updated continuously based on new sensor
tests.

Tips and Tricks

Sensor tests happen very quickly. Without the Loop in the example above, the program would test the
sensor only once and finish so quickly that you wouldnt even notice it.

TESTING FOR SPECIFIC SENSOR VALUES


The following modes allow a Switch to test for specific sensor values. You can create two or more Cases
in the Switch that correspond to different values that you want to test for, and the Switch will select the
matching Case.

Mode

Use

See

Brick Buttons
Measure

Choose between two or more Cases depending on


which Brick Button is pressed.

Using the Brick


Buttons

Brick Buttons
Compare

Choose between two Cases depending on whether


one of the selected Brick Buttons is Pressed,
Released, or Bumped.

Using the Brick


Buttons

Color Sensor
Measure - Color

Choose between two or more Cases depending on


which color is detected.

Using the Color


Sensor

Color Sensor
Compare - Color

Choose between two Cases depending on whether


or not one of the selected colors is detected

Using the Color


Sensor

Infrared Sensor
Measure - Remote

Choose from two or more Cases depending on


which button(s) are pressed on the IR Beacon.

Using the Infrared


Sensor Remote
Mode

Infrared Sensor
Compare - Remote

Choose between two Cases depending on whether a


specified button on the IR Beacon is pressed (or
whether one of a set of specified buttons is
pressed).

Using the Infrared


Sensor Remote
Mode

Touch Sensor

Choose between two Cases depending on whether


the Touch Sensor is Pressed or not, Released or not,
or Bumped or not.

Using the Touch


Sensor

Ultrasonic Sensor
Compare Presence

Choose between two Cases based on whether an


ultrasonic signal is detected in listen only mode.

Using the
Ultrasonic Sensor

Messaging

Choose between two Cases based on a message


value.

Messaging

TESTING FOR MULTIPLE VALUES


The sensor Measure modes of the Switch block allow you to specify several (two or more) different sensor
values to test for. You can give each value a different Case in the Switch. For example, in the Color

Sensor Measure Color mode, you could test for Black, White, and Red, and create three different
Cases, one for each color.

Add Case
Case Value
Default Case
Remove Case
To use multiple Cases in a sensor Measure mode, click the Add Case button to create the number of
Cases you want. For each Case, click the Case Value to select a value for the sensor from the list. You can
click the Remove Case button to remove a case.
Click the Default Case button to mark one Case as the Default Case. The Default Case is executed when

the sensor detects a value that does not match any of the Cases in the Switch.
See Programming Example: Say Red, Green, and Blue when Detected in Using the Color Sensor.
See Programming Example: A Brick Buttons Control Panel in Using the Brick Buttons.

TESTING A VALUE FROM A DATA WIRE


In the Logic, Text, and Numeric modes, the Switch can choose which Case to execute based on an input
value from aData Wire.

MODES

Logic Mode
In the Logic mode, a Switch chooses between a True Case and a False Case based on the value of
the Logic input. You could connect a Logic output from any programming block to the Logic input using
a Data Wire.
Programming Example: See the Compare Block.
Text Mode
In the Text mode, the Switch compares the value of the Text input to two or more Text values that you
specify, with a Case for each value. The Case that has a value that matches the Text input will execute. If
no values match, the Default Case will execute.
See Testing for Multiple Values above for information on creating multiple Cases. Each Case in Text mode
will have a Text value that you can type directly into its Case Value.
Example

In this example, a Switch in Text mode uses the output from a Messaging block to choose between three
different Cases, depending on which message is received.
Numeric Mode
In the Numeric mode, the Switch compares the value of the Number input to two or more Numeric values
that you specify, with a Case for each value. The Case that has a value that matches the Number input
will execute. If no values match, the Default Case will execute.
See Testing for Multiple Values above for information on creating multiple Cases. Each Case in Numeric
mode will have a Numeric value that you can enter directly into its Case Value.
Example

In this example, a Switch in Numeric mode is using the output from a Variable block to choose between
three different Cases. The Default Case of the Switch is empty, so if the value of the Action variable is
anything other than 1, 2, or 3, the Switch will do nothing.

RESIZING A SWITCH
The Switch block will usually expand automatically to make room for new programming blocks that you
drag into the Cases inside. You can also resize a Case manually if you need to. To resize a Case inside
Switch in Flat view, click on the left or right border of the Switch by the Case you want to resize, then
drag the Resize Handles that appear around the outside.

Tips and Tricks


In Tabbed view, all Cases display the same size. Resizing one Case to make it larger will make all Cases
display in the same larger space.

INPUTS
The inputs available for the Switch block will depend on the mode selected. You can enter the input
values directly into the block. Alternatively, the input values can be supplied by Data Wires from the
outputs of other Programming Blocks.

Input

Type

Notes

Logic

Logic

Used to select a Case in Logic mode

Number

Numeri
c

Used to select a Case in Numeric mode.

Text

Text

Used to select a Case in Text mode.

Compare Type

Numeri
c

Comparison type for a mode with a Threshold Value input.


0: = (Equal)
1: (Not Equal)
2: > (Greater Than)
3: (Greater Than or Equal To)
4: < (Less Than)
5: (Less Than or Equal To)

Threshold Value

Numeri
c

Value to compare sensor data to, to choose a True Case or False Case
based on a Numeric sensor value.

(Inputs for individual


sensor types)

See the help on the individual sensor types for more information on the
sensor data.

Loop Interrupt Block


The Loop Interrupt block makes a Loop block end. No more blocks in the loop
sequence will execute, and the program will continue with any blocks that are after
the loop. You can specify which Loop block to interrupt by using its Loop Name.
You can use the Loop Interrupt block to make a loop exit sooner than it normally
would, or in response to a different condition. You can interrupt a loop from inside
the loop itself, or from another block sequence that is running at the same time.
CHOOSE THE LOOP NAME

Block Text Field (Loop Name)


Name Selector
MODE
Interrupt
The Loop Interrupt block has a single mode. The Block Text Field at the top of the block displays the Loop
Name of the loop to interrupt (see the Loop block). Click the Block Text Field to display the Popup Menu.
The Popup Menu will list the names of the Loop blocks in your program. Select the name of the loop that
you want to interrupt from the list.
When the Loop Interrupt block executes, the specified loop will end immediately, and the program will
skip to any blocks that are after the loop.
Example

This program has a loop named 01 that is configured to repeat 6 times. However, a second running
sequence waits for a touch sensor to be pressed, and uses the Loop Interrupt block to stop the loop early
if the touch sensor is pressed.

Potrebbero piacerti anche