Carnegie Mellon Intro to Programming EV3 Classroom
EV3 Getting Started
Programming With The Physical Robot
1) Download the EV3 Classroom Software: Skip This Section
2) Upload Firmware: Skip This Section
3) Ports
4) Menu
A1: {Classroom Demonstration} Turn on/off the robot
A2: Connect your robot to your laptop using Bluetooth with the following steps (Classroom Demonstration)
Step 1: Turn ON your EV3 robot
Step 2: Open the EV3 Classroom Software. On your desktop click the icon below.
Step 3: Click the CONNECT button on the top of the programming area
Step 4: Follow the on screen graphic to connect your EV3 robot via Bluetooth
Step 5: Look for your robot number and click CONNECT
If your number does not show up on the list, then you will need to turn off the Bluetooth on the robot then turn it on again. Here are the steps:
Step 1: Use the menu buttons to scroll the the settings menu (the table with the wrench icon)
Step 2: Highlight Bluetooth and press the center button to turn off Bluetooth.
Step 3: Confirm by highlighting the checkmark to turn off Bluetooth.
Step 4: Highlight Bluetooth again and press the center button to turn on Bluetooth.
Step 5: Highlight the checkmark and press the center button to confirm that Bluetooth will be turned on.
Step 6: Go back to the EV3 Classroom software and look to see if your number shows up in the display.
Step 6: Look at your EV3 robot screen and click the right button to select the checkmark and press the center button
Step 7: The passkey is 1234 and that should be filled in already. Hit the center button
Step 8: It will then ask you to connect. Press the right button once to highlight the checkmark and press the center button.
Step 9: If you are connected, then you should see this at the top of the programming area.
Step 10: Click on the EV3 image with the red dot and you will see this image
Step 11: Your robot number should be listed on top.
Step 12: Show Mr. Merrill the image above proving that your robot is connected.
A3: {Video} Set Volume to 30%
A4: Set the Sleep to 60 min
Role of the Programmer
1) Answer the 2 questions. In your notebook write the 2 questions and their answers.
EV3 Movement
Introduction to Moving Forward
1) Watch the video and answer the questions.
Moving/Steering Forward
1) Robot Configuration Skip This Section
2) Follow Steps 1 through 5
3) DO NOT FOLLOW STEP 6 TO SAVE YOUR PROGRAM
A1: {Class Demonstration} Ask Mr. Merrill to show you how to create a new folder!!! Use the file name MovingForward and save it to your period folder. Show Mr. Merrill that you can Save/Open programs to/from the proper folder. Be sure to save to your programs to the correct folder!
A2: Follow steps 8 through 10. Run the program MovingForward on the robot tables and be sure to show Mr. Merrill.
A3: Mr. Merrill will show you how to delete a program from your robot.
A4: Try It! Hold Position vs. Float. Show Mr. Merrill the FLOAT setting on the robot tables.
A5: Try It! Measure One Rotation Skip This Section
4)Answer the 3 questions. In your notebook write the 3 questions and their answers.
Mini Challenge: 50 cm
1) Ask Mr. Merrill to assign you a distance to drive your robot. The challenge says 50 cm, but you may not be assigned that distance.
A1: Create and run the program named MovingForward and show Mr. Merrill that your robot travelled to assigned distance on the robot tables.
Do Not Upload Your Program File Or Video!!!
Arm Control
1) Follow steps 1-5
A1: Run the program on the robot tables and show Mr. Merrill
2) Follow steps 1-9
A2: Rename the program ArmControl and run it on the robot tables.
A3: Show Mr. Merrill how to get the program stuck using the description from Did You Know? Getting The Program Stuck?
A4: How would you create a program to make the robot drive backward now that you know how to program the arm to go backwards and forwards? Create and run a program that will make the robot drive backwards 3 rotations. Name the program Backward and run it on the robot tables
3) Answer the 3 questions. In your notebook write the 3 questions and their answers.
Mini-Challenge: Cargo Retrieval
1) Ask Mr. Merrill to assign you a distance to drive your robot. The challenge says 50 cm, but you may not be assigned that distance.
A1: Create and run the program CargoRetrieval on the robot tables
Challenge: Sensabot
1) Watch the video and read the challenge instructions
2) Ask Mr. Merrill to assign you your distances for the Sensabot Challenge.
A1: Create and run the program Sensabot on the robot tables.
Introduction to Turning
1) Watch the video and answer the questions
Turning in Place
1) Follow steps 1-6
A1: Create and run the program TurnRight (robot turns to the right 1 rotation 100% steering)
A2: Try It! Turn the Dial Modify the program TurnRight and set the dial to 25. Run the program on the robot tables.
Mini Challenge: 90 degree Turn
1) Ask Mr. Merrill to show you where and how to complete this Mini Challenge
A1: Create and run the program 90DegRight (Robot turns 90 degrees to the right at 25% power) The dial must be set to 100 to complete this challenge!
Be sure to use this block for this activity
A2: How would you make the robot turn 90 degrees left? Create and run the program TurnLeft (robot turns 90 degrees to the left at 25% power)
Other Turns
1) Follow steps 1-6
A1: Create and run the program TankMove on the robot tables
A2: Try It! Different Motions Create and run the 4 different Try It programs shown. Name the programs Tankmove1, TankMove2, TankMove3, and TankMove4 on the robot tables. Be sure to have all of the programs ready to run to receive the stamp from Mr. Merrill.
Mini Challenge Dizzy Drills
1) Ask Mr. Merrill to assign you a distance for this mini challenge
A1: Create and run the program DizzyDrill on the robot tables
Orchard Challenge
1) Watch the video and read the challenge instructions
2) Ask Mr. Merrill to show you where the Orchard Challenge will be run.
A1: Create and run the program OrchardChallenge on the robot tables. You will not be attempting Orchard Challenge 2.0 :)
Movement Quiz SKIP THIS SECTION
Boulder Math
Boulder Math Game SKIP THIS SECTION
EV3 Sensors
Sense, Perceive, Plan, Act
1) Read through the description and answer the questions at the end.
Introduction With Touch Sensor
1) Watch the video and answer the questions.
Wait For Touch
1) Robot Configuration SKIP THIS SECTION
2) Follow steps 1-7
A1: Create and run the program WaitTouch on the robot table.
3) Answer the questions
4) Try It! Pressed Already
A2: Follow the directions and show Mr. Merrill
5) Did You Know? EV3 Buttons
A3: Modify the program WaitTouch to run when the center button on the EV3 is pressed
Making Sense of Systems
1) Read through the lesson
Forward Until Touch
1) Follow steps 1-7
A1: Create and run the program ForwardTouch on the robot tables
2) Try It! Forward Until Release
A2: Modify the program ForwardRelease and run on the robot tables
3) Answer the question
Pseudocode
1) Read through the lesson, but no need to do any of the activities
Mini Challenge: Vacuum
1) Ask Mr. Merrill to show you where the Vacuum mini challenge will be run
A1: Create and run the program Vacuum on the robot tables
Challenge: Arm Position Challenge
1) Watch the video and read the challenge instructions
2) Ask Mr. Merrill to assign you a distance and show you where the challenge will be run
A1: Create and run the program ArmPostion on the robot tables
Introduction With Ultrasonic Sensor
1) Watch the video and answer the questions
Wait For Near
1) Follow steps 1-6
A1: Create and run the program UltrasonicHello on the robot tables
2) Answer the question
3) Try It! Missing Object Alarm (Wait For Far)
A2: Modify the program MissingObject and run on the robot tables
4) Try It! Sound Sentences
A3: Modify the program SoundSentences and run on the robot tables
5) Try It! Sensor Change Mode
A4: Modify the program SensorChange and run on the robot tables
6) Watch the video
Mini Challenge: Threshold Value Challenge
1) Ask Mr. Merrill to describe the challenge and where to run it
A1: Create and run the programs Threshold10 and Threshold100 on the robot tables. Be sure to have both programs ready to run!
Forward Until Near
1) Follow steps 1-7
A1: Create and run the program ForwardNear on the robot tables
2) Answer the questions
Mini Challenge Backwards Until Far
1) Ask Mr. Merrill to show you where the challenge will be run
A1: Create and run the program BackwardFar on the robot tables
Challenge: Maze Challenge
1) Watch the video and read the challenge instructions
2) Ask Mr. Merrill to show you where the challenge will be run
A1: Create and run the program Maze on the robot tables
Introduction With Gyro Sensor
1) Watch the video and answer the questions
Turn For Angle (Part 1)
1) Follow steps 1-9
A2: Ask Mr. Merrill to discuss Port View with you regarding the gyro sensor
A1: Create and run the program GyroTurn on the robot tables
2) Answer the questions
Turn For Angle (Part 2)
1) Try It! Make Modifications: Use the gyro to turn the robot right exactly 90 degrees
A1: Modify the program GyroTurn and rename it GyroRightTurn using the lesson as a guide and run on the robot tables
A2: How do you think you would use the gyro to program a 90 degree left turn? Create and run the program GyroLeftTurn and run on the robot tables. Show Mr. Merrill your program!
2) Answer the questions
3) Watch the video
Mini Challenge: Square Box Challenge
1) Ask Mr. Merrill to show you where to run the square box mini challenge
A1: Create and run the program SquareBox on the robot tables
Challenge: Mower Challenge
1) Watch the video and read the challenge instructions
2) Ask Mr. Merrill to show you where to run the mower challenge. You will not be following the directions for the mower challenge.
A1: Modify the program OrchardChallenge to use the gyro to make your turns. You must show Mr. Merrill your program prior to running it on the robot tables.
Introduction with Color Sensor
1) Watch the video and answer the questions
Wait For Green
1) Follow steps 1-6
A1: Create and run the program WaitGreen on the robot tables
2) Try It! No Color
A2: Modify the program WaitGreen and rename it NoColor. Run the program on the robot tables
3) Watch the video and answer the questions
Mini Challenge: Railroad Crossing
1) Ask Mr. Merrill to show you how to run the mini challenge
A1: Create and run the program RailroadChallenge on the robot tables
2) Answer the question
Forward Until Red
1) Follow steps 1-6
A1: Create and run the program ForwardRed on the robot tables
Mini Challenge: Forward Until Stop Line
1) Ask Mr. Merrill to show you where to run the mini challenge and which color to use
A1: Create and run the program ForwardToLine on the robot tables (Ask Mr. Merrill to point the color sensor downwards)
Traffic Signal Challenge
1) Watch the video and read the challenge instructions
2) Ask Mr. Merrill how and where to run the Challenge
A1: Create and run the program TrafficSignal on the robot tables (Robot will stop on red and go on green for 3 separate traffic lights. Ask Mr. Merrill to show you what needs to be done)
Sensors Quiz
A1: Take the quiz and show Mr. Merrill the results on your computer (Do not worry about signing in and be sure to clear the sign in banner at the top of the page. Just click the X on the right side)
EV3 Decisions
Introduction to Loops
1) Watch the video and answer the questions
Introduction Looped Movements
1) Follow steps 1-6
A1: Create and run the program MoveLoop on the robot tables
2) Answer the question
Mini Challenge: Square Lap 1
1) Ask Mr. Merrill to show you where to run the Mini Challenge
A1: Create and run the program SquareLap1 on the robot tables
Introduction Loop with Count
1) Follow Steps 1-7
A1: Create and run the program MoveLoopCount on the robot tables
2) Answer the questions
Mini Challenge: Square Lap 2
1) Ask Mr. Merrill where to run the Mini Challenge
A1: Create and run the program SquareLap2 on the robot tables
Loop With Sensor Control
1) Follow steps 1-9
A1: Create and run the program MoveLoopUltrasonic on the robot tables
2) Answer the questions
Mini Challenge: Square Lap 3
1) Watch the video and read the challenge instructions
2) Ask Mr. Merrill where and how to run the Mini Challenge
A1: Create and run the program SquareLap3 on the robot tables
Challenge: Container Challenge
1) Watch the video and read the challenge instructions
2) Ask Mr. Merrill how and where to run the Challenge
A1: Create and run the program ContainerChallenge on the robot tables. You must use the gyro sensor for your turns!!!
Introduction to If/Else Decisions
1) Watch the video
Move If Clear
1) Follow steps 1-8
A1: Create and run the program MoveIfClear on the robot tables
2) Answer the questions
Operators
1) Try It! Distance or Color
A1: Create and run the program DecisionsOr on the robot tables
2) Try It! Distance and Color
A2: Create and run the program DecisionsAnd on the robot tables
3) Answer the questions
Mini Challenge: Color Sensor Compare
1) Read the challenge instructions. However, use the following colors: Green or Blue turn right and any other colors turn left.
A1: Create and run the program ColorCompare on the robot tables
Looped Decisions
1) Follow Steps 1-7
A1: Create and run the program MazeRunner and run on the robot tables. Do not use three rotations to move forward. Change it to one rotation. Also use 30cm for the threshold value and not 50cm)
2) Complete Step 9 and ask Mr. Merrill where to run this program.
A2: Modify the program MazeRunner and run on the robot tables. Be sure to adjust rotations for moving forward to .5. The robot will make only right turns to solve the maze. The robot should stop when it sees the color
3) Answer the questions
Mini Challenge: Smarter Decisions
1) Read the instructions for the challenge
A1: Modify the program MazeRunner and run it on the robot tables
Strawberry Planter Sorter Challenge
1) Watch the video and read the instructions for the challenge and ask Mr. Merrill for the details
A1: Create and run the program StrawberrySorter on the robot tables. You will only be sorting two blocks instead of three. Use RED and Green as good plants and ANY other color as bad.
Introduction to Repeated Decisions
1) Watch the video and answer the questions
Obstacle Detection Failures
1) Follow Attempt 1 steps 1-4
A1: Create and run the program ObstacleAttempt1 on the robot tables
2) Read Attempt 1 Breakdown
3) Follow Attempt 2 steps 1-10
A2: Create and run the program ObstacleAttempt2 on the robot tables
Obstacle Detection
1) Be sure to read and follow the video introductions to this section
2) Follow steps 1-11
A1: Create and run the program ObstacleDetection on the robot tables
3) Answer the questions
Mini Challenge: Obstacle Detection Until Black
1) Read the challenge instructions
2) Ask Mr. Merrill to show you where the challenge will be run
A1: Create and run the program ObstacleLine on the robot tables
Challenge: Obstacle Orchard
1) Watch the video and read the challenge instructions and ask Mr. Merrill where the challenge will be run
A1: Create and run the program ObstacleOrchard on the robot tables. The block below will be important for successfully completing this challenge.
Introduction to Line Tracking
1) Watch the video and answer the questions
Line Tracking
1) Be sure to read the introduction of this section
2) Follow steps 1-7
A1: Create and run the program LineTrack on the robot tables
3) Answer the questions
Decisions Quiz
A1: Take the quiz and show Mr. Merrill the results on your computer (Do not worry about signing in and be sure to clear the sign in banner at the top of the page. Just click the X on the right side)
Introduction to My Blocks
1) Watch the video below and follow its directions.
A1: Create and run the program ForwardTurn on the robot tables and show Mr. Merrill that you have created a My Block.
2) What happens if you change the information inside of the My Block? Change the left turn into a right turn within the My Block below
A2: Modify and run the program ForwardTurn on the robot tables.
3) What would happen if you place two ForwardTurn My Blocks together in the main program?
A3: Modify the program ForwardTurn with two consecutive ForwardTurn My blocks and run on the robot tables.
Mini Challenge My Block Vacuum
1) In this challenge you are going to revisit the vacuum challenge from the touch sensor unit. For this challenge, you must create a program that only has Two programming blocks in the main program (A loop with a count of 4 and a My Block). The same instructions apply for this challenge as they did for the first vacuum challenge.
A1: Create and run the program Vacuum2 on the robot tables. If you don't remember, you can ask Mr. Merrill where to run the program.
Introduction to Pipeline Explorer
1) Watch the video below. Ignore the older programming version they discuss in the video.
Introduction to Oval Operators
1) Watch the video below and follow its directions.
A1: Create and run the program RandomMove on the robot tables.
2) How could you create a program that would make the robot move at a random distance from 1 to 5 rotations? In the program below, the random oval operator has been placed in the speed input slot. Which input slot would the Random oval operator need to be placed?
A2: Create and run the program RandomDistance and run on the robot tables.
Wall Distance Value
1) Watch the video below.
A1: Create and run the program WallDistanceValue on the robot tables. Try at least two different distances from the wall.
2) Lets add a loop. What will happen?
A2: Modify the program WallDistanceValue by adding a loop and run the program several times on the robot table at different distances from the wall.
3) What would happen if you use the block below instead and place the ultrasonic oval operator in the speed oval operator input?
A3: Modify the program WallDistanceValue and run it on the robot tables. Notice the difference?
4) Big Delay
Step #1: Recreate the first version of the program created in activity #1
Step #2: Place a 5 second wait block in the beginning of the program.
Step#3: Face the robot towards a wall, then run the program. After starting the program, place your hand in front of the ultrasonic sensor. What distance will the robot use for the speed?
A4: Create and run the program BigDelay on the robot tables.
Mini-Challenge: Dangerous Wall
1) You have created a program that slows the robot down as it approaches a wall. What if you wanted to stop the robot before it hits the wall? Did you notice that there is another operator with pointed shapes on the sides? Where would you be able to place these operators?
Displaying Data
1) Your EV3 is capable of displaying data and images on its display screen. You can access the display blocks by clicking on the blue Display circle on the left of the EV3 Classroom programming screen. The available blocks look like this:
To create an item to display on the EV3 screen just select the appropriate block and insert it in your program. For example, let's make a program that displays the word HELLO on the EV3 display screen.
Create and run the program HelloDisplay but you do not need to show Mr. Merrill. What did you notice? The word HELLO will flash very quickly and not be viewable. What can you do to make the display last longer?
A1: Modify and run the program HelloDisplay, make the word display for 5 seconds and show Mr. Merrill.
How would you display the amount of degrees the robot the robot moves? You would simply insert an oval operator in the spot where the text would be written:
The problem is that the default port on the block is the A motor, which represents the amount of rotations the robot arm moves. We need to change the port to either B or C. These are the ports that are connected to the motors that move the robot.
The last problem is that the display will only briefly flash the result on the display. We could add a wait block, but that would only show one result. Let's add a loop to continuously update the display with the new degree numbers as we push the robot along.
A2: Create and run the program DegreeDisplay and Show Mr. Merrill. Simply push the robot to see the degrees of movement.
2) What would happen if you decided to display the ultrasonic sensor threshold value instead of wheel rotation degrees?
A3: Create and run the program UltrasonicDisplay and show Mr. Merrill. Use your hand to see the ultrasonic distance change on the display.
3) What would happen if you wanted to display color values of different colored objects?
A4: Create and run the program ColorDisplay and show Mr. Merrill. Hold different colors in front of the color sensor to see them displayed on the screen.
4) Display Position
Step #1: Choose the following block to change the position of your text.
Step #2: Type the word "CENTER" in the write oval operator
Step#3: Try to find the correct combination of X and Y values to place the the word "CENTER" in the middle of the display screen. Here are some helpful hints about the EV3 display screen. (Remember: The X coordinate represents the position on the screen from left to right (1 is on the far left of the screen) and the Y coordinate represents the position on the screen from up to down (1 is on the top of the screen)
A5: Create and run the program CenterDisplay and show Mr. Merrill.
5) Can you display an image while the robot is moving?
A6: Create and run the program ImageMove. Create a program that drives towards a wall, stops approximately 20 cm from it, and turns to the left. Your program must incorporate 4 different images. Be creative!
Mini Challenge Multiple Display
1) You can display multiple pieces of information, if you choose different X and Y coordinates so they don't overwrite each other. Your display should look like the one pictured below:
A1: Create and run the program MultiDisplay and show Mr. Merrill. Push the robot towards a wall to see the display values change.
Calculation
1) Degrees are meant to describe the size of an angle and not the distance that a robot drives. It would be more convenient to display information that is easily understandable. For this section we will learn how to convert the degrees of wheel movement into centimeters and display that on our EV3 screen. The first thing we need to understand is that the wheels on your EV3 robot moves about 17 cm for every one wheel rotation or every 360 degrees.
The math looks like the following:
1 rotation = 17 cm 2 rotations = 34 cm 3 rotations = 51 cm and so on...
It is easy to convert rotations to centimeters by multiplying the number of rotations by 17:
1 rotation x 17 = 17 cm 2 rotations x 17 = 34 cm 3 rotations x 17 = 51 cm and so on...
The problem is that EV3 classroom scratch blocks can only measure the amount of degrees the robot wheels turn:
360 degrees = 17cm 720 degrees = 34 cm 1080 degrees = 51 cm and so on...
That makes the math a bit different. To convert degrees to to centimeters, we need to multiply by .0474:
360 degrees x .0474 = 17.064 cm 720 degrees x .0474 = 34.128 cm 1080 degrees x .0474 = 51.192 cm
It isn't perfect but you will see that it is a close when using the physical robot. To display the amount of centimeters our robot drives on the EV3 screen we will need to use a math block to multiply the amount of degrees by .0474. Before you used a program like this to display the amount of degrees the B or C motors moved:
We will need to modify this program if we would like to display the amount of centimeters the robot moves. First we will need to grab a multiplication calculation block from the Operators tab:
Then you will need to insert the multiplication block in the area where you would write the text:
You will then need to place the oval operator for the amount of degrees counted on Port B or C and multiply that value by .0474:
The value that will be displayed on the EV3 screen will be the amount of centimeters your robot has traveled. Try it out on the robot tables using the measurement mats.
A1: Create and run the program DisplayCM and show Mr. Merrill
Mini Challenge Display Degrees in Centimeters
1) Add calculation oval operators to the MultiDisplay program from the previous Mini-Challenge, so that the two distance values display in centimeters and not degrees.
A1: Create and run the program DisplayCM and show Mr. Merrill. Your display should look like the picture below:
Mini-Challenge Move For Centimeters My Block
1) In this mini-challenge you will be creating a My Block that will drive the robot a selected amount of centimeters. Your program will include a My Block that allows for numbered inputs in the block. An input is a number that you type in the My Block and that number can be used throughout the My Block program with the use of an oval operator. The end result will look like this:
In the Move My Block you would simply type a number in the oval operator and that number can be used within the program.
Here is how to create a My Block that has inputs and labels:
Step#1: Click on the My Block tab on the left of the screen and click "Make a Block"
Step #2: Click on "Add an Input" and "Add a Label"
Step #3: In the block name space type "Move Centimeters". In the oval input space where it says "number or text" type "centimeters" and in the rectangular label text area type "cm".
Step #4: Click Save and you will see that your program looks like the image below.
Step #5: You can drag the centimeter input oval to any of the input operator spaces within the blocks you choose as part of your My Block program. This is just an example. You will need to decide what your My Block program will look like and where to place the centimeter input block. You can even place a math block with inputs inside of an input operator with the same shape!
You can even place a math block with inputs inside of an input operator with the same shape like the example below:
Step #6: The picture above is just an example and does not represent the correct programming for your My Block for the mini-challenge solution!
The trick to completing this program is to figure out how to convert centimeters into degrees. You learned how to convert degrees into centimeters by multiplying the degrees by .0474. How do you go backwards and convert centimeters into degrees?
When your program is complete it will look like the program below. However, you are responsible for building the My Block that runs the program. Start with 50 cm and rotate the arm downwards so that it is on top of the zero centimeters mark on the measurement map. Run the program and see if the robot drives to the selected distance. Try another distance to see if it works.
A1: Create and run the program MoveForCM on the robot tables. Mr. Merrill will select two different distances for you to travel in centimeters. You should be able to change to input on your My Block and the robot will travel that input distance.
Variables
1) Watch the videos below.
A1: Create and run the program CaveDisplay on the robot tables. Ask Mr. Merrill where you will need to run this program.
Mini Challenge Find the Black Lines Distance
1) Program your robot to find the first line on the floor of the cave and report its distance from the entrance in motor degrees.
A1: Create and run the program CaveLine on the robot tables. Ask Mr. Merrill where to run the program and make sure the color sensor is facing downwards. Here are some hints:
Drive into the box until your robot locates the black line
Record the degree sensor value at that time into a variable and convert degrees into centimeters
Return to the entrance
Display the Centimeter value you recorded in your variable block on the EV3 screen
Pipeline Explorer Challenge
1) Watch the video below.
A1: Create and run the program PipelineExplorer on the robot tables. Ask Mr. Merrill where you will need to complete this challenge. You will need to do the following:
Drive into the pipe and locate the damaged section of the pipe (represented by a black line)
Store the distance to the damaged section in centimeters. Do you remember how to convert degrees into centimeters?
Continue driving until you discover the end of the damaged section (represented by the end of the black line)
Store the distance of the damaged section of the pipe in centimeters
Back out of the pipe and display the length to the damaged section and the thickness of the damaged section on the EV3 screen. Be sure to clearly label the information displayed.
Your robot will need to complete this challenge for two different damaged sections.
You should consider using My Blocks whenever it seems appropriate.