0% found this document useful (0 votes)
33 views

EV3RSTORM

Mindstorms EV3 313131 EV3RSTORM Building Instructions

Uploaded by

Wojciech Smołka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views

EV3RSTORM

Mindstorms EV3 313131 EV3RSTORM Building Instructions

Uploaded by

Wojciech Smołka
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Moving, Turning, Move Until,

Loops and Switches,


Using Sensors

Photo Credits: EV3STORM images by LEGO


§ Can you identify the following
parts on your robot?
§ 1 EV3 Brick
§ 1 Touch Sensor
§ 1 Color Sensor
§ 1 Infrared Sensor
§ 2 Large Motors
§ 1 Medium Motor

Copyright EV3Lessons.com, 2016 HOUR OF EV3 2


Infrared Color
Sensor Sensor
Touch Port 4 Port 3
Sensor
Port 1

Medium Motor
EV3 Brick Port A

Large Motor
Ports B & C

Copyright EV3Lessons.com, 2016 HOUR OF EV3 3


START
HERE

Copyright EV3Lessons.com, 2016 HOUR OF EV3 4


Download
&
Start Play
Block
Note: This
shows up only
Drag
when your
programming
robot is
blocks from
connected.
below and
Press the Play
attach them to
button to test
this block
your code on
your robot

Programming Blocks in
Brick Status
3 Colored Palettes
Copyright EV3Lessons.com, 2016 HOUR OF EV3 5
§ In this activity, you will program EV3RSTORM to move forward
until it’s Touch sensor is pressed. Then you will make the robot
move back 720 degrees and then make a right turn of 1000
degrees.
§ Your robot will Move Until the touch sensor is Pressed

Copyright EV3Lessons.com, 2016 HOUR OF EV3 6


Select Mode
“On” Mode Rotations Mode

Steering Number of
(Straight or Turns) Rotations
Power (Forward
§ Move Steering Block or Backwards)
§ Wait Block
§ In “On” mode, the motors are turned on and the program
moves to the next block immediately § This block lets you
§ In Rotations mode, you can tell the robot to move a wait until
specific number of rotations of the motor something
§ The Steering value sets whether your robot should move § Select the Touch
straight or turn Sensor in Pressed
§ Using a negative number in the Power value tells your Mode
robot to move backwards

Copyright EV3Lessons.com, 2016 HOUR OF EV3 7


§ STEP 1: Turn the motors on

§ STEP 2: Wait until Touch Sensor is pressed

§ STEP 3: Move robot straight and backwards 3 rotations

§ STEP 4: Make your robot turn right 3 rotations

Copyright EV3Lessons.com, 2016 HOUR OF EV3 8


Move Steering Move Until the Move Steering Move Steering
Block in “On” Touch Sensor Block set to go Block set to turn
Mode. Set to is Pressed backwards
go forward

Copyright EV3Lessons.com, 2016 HOUR OF EV3 9


§ In this activity, you will program EV3RSTORM to
move forward when the color sensor detects green,
stop when it detects red, and slow down when it
identifies yellow.
§ You are having your robot choose between multiple
actions,
§ In the EV3 programming language, you use a SWITCH
statement
§ You are also going to have the robot keep repeating
the action again and again
§ In the EV3 programming language, you use a LOOP
§ Collect a few spare red, yellow and green LEGO
blocks for your traffic light (see image)

Copyright EV3Lessons.com, 2016 HOUR OF EV3 10


§ Loop Block set to infinite
§ Switch Block based on the
§ This Block lets you repeat Color Sensor’s readings in
your code Measure Color Mode
§ Click on the
“+” and create 4 tabs – Red,
• Sound Blocks Green, Yellow and No Color
let your robot
make sounds
• Select File
Mode Choose
“Colors”
Copyright EV3Lessons.com, 2016 HOUR OF EV3 11
§ STEP 1: Start with the Switch Block with 4 tabs

§ STEP 2: Add the code to each of the 4 tabs


§ No Color – Leave blank since we want the robot to
do nothing
§ Red – Turn the Motor “Off” and Say “red”
§ Yellow – Turn the Motor “On”, move slower (lower
the power), say “yellow”
§ Green – Turn the Motor “On”, move faster
(increase the power), say “green”

§ STEP 3: Place the entire switch in a Loop

Copyright EV3Lessons.com, 2016 HOUR OF EV3 12


When the robot reads no color When the robot reads yellow, the
the robot does nothing robot moves at 20 power

When the robot reads red, the


When the robot reads green, the
motors stop
robot moves at 40 power
Copyright EV3Lessons.com, 2016 HOUR OF EV3 13
§ In this activity, you will program EV3RSTORM to move forward
until it is a certain distance away from you or move back if it is too
close
§ Use the Infrared sensor on your robot to detect when it sees a
hand
§ You will combine the concepts of Move Until, Switches and Loops
with the Infrared sensor
§ Please make sure you use low values for power (~30) to make sure
your robot doesn’t fall over

Copyright EV3Lessons.com, 2016 HOUR OF EV3 14


§ Loop Block set to infinite § Switch Block based on the
Infrared Sensor’s readings in
§ This Block lets you repeat
Compare Proximity Mode
your code

Copyright EV3Lessons.com, 2016 HOUR OF EV3 15


§ STEP 1: Start with the Switch Block that uses the
Infrared Sensor in Compare Proximity mode
with 2 tabs

§ STEP 2: Add the code to each of the 2 tabs


§ Greater than 25 proximity – Make the robot move
forward using a Move Steering block slowly (30
power)
§ Less than 25 proximity – Make the robot move
backwards using negative power in the Move
Steering Block. Go slow.

§ STEP 3: Place the entire switch in a Loop

Copyright EV3Lessons.com, 2016 HOUR OF EV3 16


When the Infrared
Sensor is greater than
25 proximity go
forward slowly

When the Infrared


Sensor is less than 25
proximity go
backwards slowly
(negative power value)

Copyright EV3Lessons.com, 2016 HOUR OF EV3 17


§ Using the Move Steering, Move
Until, Sound, Loop and Switch
blocks try some of these
additional challenges:
§ Program the robot to move and talk
§ Program the robot to follow the
Infrared Beacon
§ Program to find a target and shoot
balls (you will need to also use the
Medium Motor block)
§ Program the robot to display
images on the screen (you will
need to also use the Display Block)

Copyright EV3Lessons.com, 2016 HOUR OF EV3 18

You might also like