Beruflich Dokumente
Kultur Dokumente
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.
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.
Programs
You can create programs by dragging Programming Blocks (from the Programming Palettes, at the
bottom of the screen) onto the Programming Canvas.
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.
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.
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:
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.
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
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
WI-FI CONNECTION
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.
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.
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:
immediately
DOWNLOADING AN EXPERIMENT - EDUCATION EDITION ONLY
The Brick Information tab displays important information about the EV3 Brick that is currently connected.
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
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.
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.
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
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.
B, C
23
C, B
32
A, B
12
A, D
14
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)
103 (or 3)
104 (or 4)
B, C
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.
Type
Logic
Numeric
Text
Numeric Array
Block Input
Block Output
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
Example
Data Wire)
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.
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.
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.
You cannot connect more input Data Wires to the same hub.
From Type
To Type
Result
Logic
Numeric
False = 0
True = 1
Logic
Text
False = 0
True = 1
Logic
Logic Array
Logic
Numeric Array
Numeric
Text
Numeric
Numeric Array
Logic Array
Numeric Array
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.
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]
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.
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
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.
Go to Experiment
Open Website
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.
File Type
File Extension
Programs
Data Logging Experiments
.ev3p (programs)
.ev3e (experiments)
Sound Files
.rsf
.rgf
.rdf
.ev3
.rtf
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.
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.
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
CTRL+F
Command-F
Screenshot
CTRL+I
Command-I
CTRL+M
Command-M
CTRL+N
Command-N
New Program
CTRL+E
Command-E
New Experiment
CTRL+O
Command-O
Open...
CTRL+P
Command-P
CTRL+Q
Command-Q
Quit
CTRL+R
Command-R
CTRL+S
Command-S
Save
CTRL+Shift+S
Command-Shift-S
Save Project As
CTRL+T
Command-T
Prediction
CTRL+U
Command-U
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
Right arrow
Right arrow
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
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.
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
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:
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
REMOTE MODE
Infrared Sensor
Remote Infrared Beacon
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.
Data
Type
Values
Notes
Detected
Logic
True/False
Proximit
y
Numeric
0 to 100
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.
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
Wait for the beacon to be detected and for the Heading to reach a specified value.
Wait
Wait for the beacon to be detected and for the Proximity to reach a specified value.
Wait
Wait
Loop
Repeat a sequence of blocks until the beacon Heading reaches a specified value.
Loop
Switch
Switch
Infrared
Sensor
Measure - Beacon
Trasforma distanza e direzione in Numeric data wires, e lo stato rilevato in Logic data
wire.
Infrared
Sensor
Compare the beacon Heading to a threshold, and get the result on a Logic data wire.
Infrared
Sensor
Compare the beacon Proximity to a threshold, and get the result on a Logic data wire.
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.
Data
Proximit
y
Numeri
c
Numeric
Values
0 to
100
Notes
valore dipende dal colore e materiale dell'oggetto di fronte al sensore, e altri fattori.
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.
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.
Mode
Use
Wait
Wait
Loop
Switch
Infrared
Sensor
Measure - Proximity
Infrared
Sensor
Compare Proximity
Infrared Sensor
Remote Infrared Beacon
Data
Button
ID
Type
Numeri
c
Rang
e
0 - 11
Notes
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.
Block
Mode
Use
Wait
Infrared Sensor
Compare Remote
Wait
Infrared Sensor
Change - Remote
Loop
Infrared Sensor
Remote
Switch
Infrared Sensor
Measure Remote
Switch
Infrared Sensor
Compare Remote
Infrared
Sensor
Measure - Remote
Infrared
Sensor
Compare Remote
Data
Type
Range
Notes
Distance in Centimeters
Numeric
0 to 255
Distance in Inches
Numeric
0 to 100
Ultrasound Detected
Logic
True/False
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.
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.
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.
Mode
Use
Wait
Wait
Wait
Loop
Loop
Loop
Switch
Switch
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.
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.
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.
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.
Data
Type
Range
Notes
Color
Numeric
0-7
Light
Numeric
0-100
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.
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%.
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
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.
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.
Block
Mode
Use
Wait
Wait
Wait
Wait
Wait
Wait
Loop
Loop
Loop
Switch
- Color
Switch
Switch
Switch
Color
Sensor
Measure - Color
Color
Sensor
Measure - Reflected
Light Intensity
Color
Sensor
Measure - Ambient
Light Intensity
Color
Sensor
Compare - Color
Color
Sensor
Compare - Reflected
Light Intensity
Color
Sensor
Compare - Ambient
Light Intensity
Data
Logging
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.
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.
If you measure a timer that has never been reset, you will get the elapsed time since the program
started.
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.
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.
Mode
Use
Wait
Wait
Loop
Timer
Switch
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
Block
Mode
Use
Wait
Time
Loop
Time
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.
Data
Type
Notes
State
Logic
Pressed
Logic
Released
Logic
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.
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.
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.
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.
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.
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
False
True
False
True
False
False
True
False
False
Button is released
False
True
True
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.
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).
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).
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.
Block
Mode
Use
Wait
Touch Sensor
Compare
Wait
Loop
Touch Sensor
Switch
Touch Sensor
Touch
Sensor
Measure
Touch
Sensor
Compare
Data
Logging
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.
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.
Data
Type
Notes
Button
ID
Numeri
c
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.
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.
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.
Block
Mode
Use
Wait
Brick Buttons
Compare
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
Switch
Switch
Brick
Buttons
Measure
Brick
Buttons
Compare
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.
Data
Type
Notes
Degrees
Numeri
c
Rotations
Numeri
c
Current
Power
Numeri
c
Step
1
Action
Program starts, motor has not turned yet
360 degrees
720 degrees
780 degrees
750 degrees
0 degrees
-100 degrees
-160 degrees
200 degrees
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.
If the Power input to the Large Motor block is greater than 100, it will use 100% power.
Block
Mode
Use
Wait
Wait
Loop
Motor Rotation
Switch
Motor Rotation
Motor
Rotation
Measure
Motor
Rotation
Compare
Motor
Rotation
Reset
Data
Logging
Blocks
Modes
Use
Medium
Motor,
Large Motor
On for
Degrees,
On for
Rotations
Move
Steering,
Move Tank
On for
Degrees,
On for
Rotations
Data
Type
Notes
Angl
e
Numeri
c
Rate
Numeri
c
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.
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.
The table below shows the programming blocks and modes that you can use with the Gyro Sensor.
Block
Mode
Use
Wait
Wait
Loop
Gyro Sensor
Switch
Gyro Sensor
Gyro
Sensor
Measure
Measure the rotation angle and/or rate, and get the result on
a Numeric data wire.
Gyro
Compare
Sensor
Gyro
Sensor
Reset
Data
Logging
Gyro Angle
Gyro Rate
Data
Type
Range
Notes
Sound Level
(dB)
Numeri
c
0 to
100
Sound Level
(dBA)
Numeri
c
0 to
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.
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.
Block
Mode
Use
Wait
Wait
Loop
Sound Sensor
Switch
Sound Sensor
NXT Sound
Sensor
Measure
NXT Sound
Sensor
Compare
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.
When you are happy with the size and placement of the image, click Next.
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.
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
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.
Steps
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.
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.
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.
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.
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.
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.
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.
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
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
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.
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
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
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.
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
Rotations
Degrees
360
720
0.5
180
1.25
450
7.2
2592
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.
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
Brake at
End
Logic
True/False
Seconds
Numeric
Degrees
Numeric
Any Number
Rotations
Numeric
Any Number
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
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
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.
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
Rotations
Degrees
360
720
0.5
180
1.25
450
7.2
2592
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.
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
Brake at
End
Logic
True/False
Seconds
Numeric
Degrees
Numeric
Any Number
Rotations
Numeric
Any Number
Left motor
Right motor
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.
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.
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.
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.
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
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.
Rotations
1
Degrees
360
720
0.5
180
1.25
450
7.2
2592
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.
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
Steering
Numeri
c
-100 to 100
Steering direction.
See Steering and Motor Speed.
Brake at
End
Logic
True/False
Seconds
Numeri
c
Degrees
Numeri
c
Any Number
Rotations
Numeri
c
Any Number
Left motor
Right motor
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.
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.
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.
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.
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
Rotations
Degrees
360
720
0.5
180
1.25
450
7.2
2592
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.
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
Power
Right
Numeric
-100 to 100
Brake at
End
Logic
True/False
Seconds
Numeric
Degrees
Numeric
Any Number
Rotations
Numeric
Any Number
Display Block
The Display block can display text or graphics on the EV3 Brick display.
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.
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
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.
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
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
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.
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.
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 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).
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
File
Name
Text
Name of an existing
Image file
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
Row
Numeri
c
0 to 11
Numeri
c
0 to 177
Numeri
c
0 to 127
X1
Numeri
c
0 to 177
Y1
Numeri
c
0 to 127
X2
Numeri
c
0 to 177
Y2
Numeri
c
0 to 127
Radius
Numeri
c
Width
Numeri
c
Height
Numeri
c
Fill
Logic
True/False
Color
Logic
False = Black
True = White
Font
Numeri
c
0 = Normal
1 = Bold
2 = Large
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.
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.
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
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
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
Note
Text
C through B,
followed optionally by
#, followed by 4
through 6.
Frequenc
y
Number
300 to 10000
Tone frequency in Hz
Duration
Number
Volume
Number
0 to 100
Play Type
Number
0, 1, or 2
A-G
C
Do,R,Mi
Do
Mi
Fa
Sol
La
Si
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
This program makes the Brick Status Light pulse orange while the robot is driving backwards, then turns
the light off.
Off
The Reset mode returns the Brick Status Light to the standard green blinking pattern that indicates a
program is running on the EV3 Brick.
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
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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
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
Input
Type
Notes
Seconds
Numeric
Compare Type
Numeric
Threshold Value
Numeric
Direction
Numeric
1 = Decrease
2 = Any
Amount
Numeric
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
Notes
See the help mode on the individual sensor types for more
information on the sensor data.
Numeric
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.
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.
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.
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
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.
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.
Mode
Brick Buttons
Notes
Loop repeats until one of the selected buttons does the selected
action.
See Using the Brick Buttons.
Touch Sensor
Ultrasonic Sensor
Presence
Messaging
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.
Input
Type
Notes
Count
Numeric
Seconds
Numeric
Until
Logic
Compare Type
Numeric
Threshold Value
Numeric
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.
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.
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.
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.
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.
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.
Mode
Use
See
Brick Buttons
Measure
Brick Buttons
Compare
Color Sensor
Measure - Color
Color Sensor
Compare - Color
Infrared Sensor
Measure - Remote
Infrared Sensor
Compare - Remote
Touch Sensor
Ultrasonic Sensor
Compare Presence
Using the
Ultrasonic Sensor
Messaging
Messaging
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.
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.
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
Number
Numeri
c
Text
Text
Compare Type
Numeri
c
Threshold Value
Numeri
c
Value to compare sensor data to, to choose a True Case or False Case
based on a Numeric sensor value.
See the help on the individual sensor types for more information on the
sensor data.
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.