Академический Документы
Профессиональный Документы
Культура Документы
MINDSTORMS
PROGRAMMING CAMP
Instructor Notes
What is a robot?
ì Take Turns
ì Do not drop, throw, push on the robot – they are very expensive
Instructor Notes
ì We use the NXT brick but program with the EV3 software. The
NXT brick has less memory.
ì You will have to delete the files often (at the end of every session)
ì Students who create and use a lot of sound files will fill in the
brick faster.
ì We asked students to make a new project file each day for their
programs.
BEGINNER EV3 PROGRAMMING
Lesson: Introduction
Topics Covered:
NXT Basics
Introduction to the NXT Brick and EV3 Software
9
Lesson Objectives
ì 2 = Center Button à
Select options
Run Program
Turn robot on 2
1 1
ì 3 = Back à
Undo
3
Stop Program
Turn robot off
11
Menus on Screen
1. My Files
Find programs you
downloaded
2. Use left/right
buttons to find other menus
such as “View”
12
Ultrasonic sensor:
Color Make your robot
measure distances
B
sensor:
Make Default
your setup Front
robot
detect Ports 1, 2, 3, 4 = Sensors C
colors
13
EV3 Software
File..Save Project As
Project Properties
List of programs
16
Click on a
program tab
to bring up Programming
the Area or Canvas
programming The Communication Pane
canvas.
Connection status
Download programs ready to be run
Download/play programs instantly
Download a section of a program to
run
Intelligent EV3 Brick status: name and
battery level, etc.
Port status and sensor readings
Programming Blocks in
Type of connection between the EV3
Brick and the computer (BT, Wi-Fi, or Brick Status &
USB)
6 Colored Tabs Downloading
19
1 2 3 4 5 6
EV3 PROGRAMMING
Lesson: Moving Straight
22
Lesson Objectives
FINISH
1. Learn how to make your robot
go forward and backwards
C
B
START
23
Mode of Brake/
operation Coast
Negative Power =
Backwards
Positive Power =
Forward
27
CHALLENGE 2:
Move Straight (3 SECONDS)
Step 3
STEP 1: Green Block Tab, Click and
hold Move Steering and drag to
programming area
C
B
START
29
CHALLENGE SOLUTION
Lesson Objectives
1. Make a robot baseball player
B
C
Second
Base
C
B B
C
Start and
First
End Base
position
34
C C C C
Pivot Turn Right Pivot Turn Left Spin Turn Right Spin Turn Left
Measuring Turns
315 45
300 60
285 75
270 90
255 105
240 120
225 135
210 150
195 165
180
37
B ?
B
C
C
Motor
degrees
39
TURNING CHALLENGES
Challenge 1 Challenge 2
ì Your robot is a baseball player who ì Your robot baseball player must run
has to run to all the bases and go to second base, turn around and
back to home plate. come back to first.
ì Can you program your robot to move ì Go straight. Turn 180 degrees and
forward and then turn left? return to the same spot.
B
C
Start and
First
End Base
position
40
CHALLENGE SOLUTIONS
Challenge 1 Challenge 2
ì You probably used a ì You probably used a spin
combination of move turn because it is better for
steering to go straight and tighter turns and gets you
do pivot turns to go around closer to the starting point!
the box.
Second
Base
B
C
Start and
First
End Base
position
42
Review
LESSON OBJECTIVES
Display Block
• The Display Block to show
information and pictures
on the screen
Display!!!!!
• You can control the
location and size of text
Step 1:
Pick Display Block
Step 3:
Use the box on the top right to
enter the text you want to display
48
Wait Blocks
ì Wait blocks make your program pause for some time (or until
something happens) before moving to the next step
Challenge 3 solution
54
Step 2:
Click on the “Select Mode” which
has a folder icon and pick
“image”
Step 3:
Use the empty box on the top
right to pick the image you want
to display
CHALLENGE 4 Solution
ì Why might you want to know how to use the display block?
ì You might want to know what the sensor value your robot is
seeing
ì You might have to program a robot to stop when the robot
reaches a red line but it stops before
ì Does the robot see the same thing you see?
ì You can display the value on the screen and check
Lesson Objectives
1. Make a robot that wanders the room – bumps into walls and
turns around
B
C
C C
60
What is a sensor?
• A sensor lets an EV3 program measure and
collect data about is surroundings
Yellow Sensor Tab: Sensor Blocks Orange Flow Tab: Wait for Block
CHALLENGE 1
ì Program your robot to
move straight until you
tap the sensor with your
hand.
B 0 = released
1 = pressed
2 = bumped
C
Challenge 1 Solution
ì Add screenshot
66
CHALLENGE 2
ì Program your robot to
move until it hits the edge
of a wall. Then back up
and turn right 90 degrees. 0 = released
1 = pressed
2 = bumped
B
C
Hint: You will combine Move
Steering + Turning + Wait Block
67
Challenge 2 Solution
ì Add Screenshot
68
DISCUSSION
ì Why did you use MOTOR ON for these challenges?
ì You want to read the sensor while the motor is on.
ì What are some situations you might want to use each of these for?
ì PRESSED = running into a wall, BUMPED = tapped by hand
RELEASED = no longer touching a wall
BEGINNER EV3 PROGRAMMING
Lesson: Color Sensor
70
Lesson Objectives
FINISH
1. Make the robot move up to the green
line without doing any measurement!
C
B
START
71
• What are they? Sensors that detect the intensity of light that enters it
• Three modes: Color, Reflected Light Intensity and Ambient Light Intensity
ì Color Mode: Recognizes 7 colors (black, brown, blue, green, yellow, red,
white) and No Color
ì Reflected Light: Measures the intensity of the light reflected back from a
lamp that emits a red light. (0=very dark and 100=very light)
ì Ambient Light: Measures the strength of the light that enters the sensor
from the environment. (0=very dark and 100=very light)
FINISH
START
BEGINNER EV3 PROGRAMMING
Lesson: Loops
Lesson Objectives
Repeating an Action
The LOOP Block
How can we move around bases using
ì• Sometimes, there are actions that you want to repeat. The LOOP block allows you
to repeat those actions until an end condition is met (or becomes TRUE).
the commands we already know?
• Example: make the robot move around a box and return to its starting position
ì (move + turn) + (move + turn) + (move + turn)
• To move along the box sides, it takes 8 blocks as follows:
Loops
The LOOP Block
• Sometimes, there are actions that you want to repeat. The LOOP block allows you
to repeat those actions until an end condition is met (or becomes TRUE).
• Example: make the robot move around a box and return to its starting position
• To move along the box
The LOOP sides, it takes 8 blocks as follows:
Block
ì Loops make repeating a task multiple times easy
• Sometimes, there are actions that you want to repeat. The LOOP block allows you
to repeat those actions until an end condition is met (or becomes TRUE).
else)
• To move along the box sides, it takes 8 blocks as follows:
Warning: Deleting the LOOP block will also delete all the blocks within the
loop. You can move the blocks out of the loop, then delete it.
Warning: Deleting the LOOP block will also delete all the blocks
45 within the
loop. You can move the blocks out of the loop, then delete it.
78
LOOP CHALLENGE
Lesson Objectives
1. Get the robot to show a happy face when you press its button
and a sad face when you don’t
Switch Blocks
Run this code if
ì Asking the robot a question the answer is yes
and doing something
different based on the
answer
ì Example: Does the robot
see a line? Or not?
ì Basically a YES/NO
QUESTION
ì Switch blocks are found in
the orange/flow tab The question being Run this code if
asked: is the touch the answer is no
sensor pressed
83
Challenge 1 SOLUTION
Display Block
Challenge 2 solution
BEGINNER EV3 PROGRAMMING
Lesson: Ultrasonic Sensor
LESSON OBJECTIVES
ULTRASONIC
• An ultrasonic sensor measures distance.
• You use it when you need to make sure you are a certain distance
away from a target.
Ultrasonic Challenge 1
ì Challenge: Make the robot
move until it is 5 inches away
from the wall.
ì Step 1: Make a new program
Challenge 1 solution
92
Challenge 2 Solution
BEGINNER PROGRAMMING
Lesson: Basic Line Follower
95
LESSON OBJECTIVES
1. Learn how to make a robot follow a line
Instructor Notes
The answer
depends on what
side of the line you
are following!
102
✔ ✔ ✗
103
C
B
B
104
CHALLENGE 1 SOLUTION
DISCUSSION GUIDE
ì Why is it important for the robot to follow the same side of the line?
ì This is a basic line follower. What are some things that were not good about this line
follower? Do you think the line follower can be improved?
ì It wiggles a lot. Smoother line followers are described in the Advanced lessons.
ì The rotation sensor used in Challenge 2 solution measures how much the wheels
have turned.
ì How would you write a line follower that will stop when it sees a line? Or another
color?
Basic Mat
112
CREDITS
• This tutorial was created by Sanjay Seshan and Arvind Seshan