Module 3. Programming

LEGO Mindstorms EV3 Programming


2. Solutions to common brick-related issues

2.1. My brick is frozen If your EV3 Brick suddenly gets frozen, you will need to reset your EV3 Brick. 1) Hold down the Back and Center buttons on the EV3 Brick. 2) When the screen goes blank, release the Back button. 3) When the screen says “Starting,” release the Center buttons. 4) Be sure […]

3. Moving Straight

3.1. Negative and positive power. Backward and Forward 3.2. How do you move straight? STEP 1: Green Block Tab, Click and hold Move Steering and drag to programming area STEP 2: Drop next to the Start Block (green arrow) (See animation) Challenge 1 Move straight 3 seconds STEP 1: Green Block Tab, Click and hold […]

4. Pseudocode

4.1. What is Pseudocode? Robots follow directions that people give them. They need detailed, step-by-step instructions to complete a task. It is a set of detailed notes that the programmer can use to write the code when they are ready. It is not written in any particular programming language. Pseudocode can be in part English […]

5. Basic Turning

5.1. Pivot vs. Spin Turns Notice where the robot ends in both pictures after a 180 degree turn. In the Spin Turn, the robot moves a lot less and that makes Spin Turns are great for tight positions. Spin turns tend to be a bit faster but also a little less accurate. So when you […]

6. Displaying Text and Graphics

6.1. Display Block • The Display Block to show information and pictures on the screen • You can control the location and size of text • You can use this same block to display sensor readings and instructions. Located in Green Tab MORE ON Display Blocks Two modes to display Pixel mode (Use for displaying […]

7. Custom Images and Sounds

7.1. Adding Custom Images STEP 1: Select Image Editor from the EV3 Menu Note: The Image Editor can open .rgf, .jpg, .png, and .bmp files. Color images are automatically converted to monochrome images. The .rgf file extension is what LEGO uses. STEP 2: Open your image STEP 3: Change its size using the buttons and […]

8. Touch Sensor

8.1. What is a sensor? A sensor lets an EV3 program measure and collect data about is surroundings The EV3 sensors include: • Color – measures color and darkness • Gyro – measures rotation of robot • Ultrasonic – measures distance to nearby surfaces • Touch – measures contact with surface • Infrared – measures […]

9. Color Sensor

9.1. What is the Color Sensor? 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 […]

10. Loops

10.1. Repeating an action Let’s say we want the robot to repeat an action over and over again. Would you just copy the block multiple times? What if I want to repeat that block forever? Loops make repeating a task multiple times easy The added benefit is that a loop can end whenever you want […]

11. Switches

11.1. Switch Blocks Asking the robot a question 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 Challenge 1 Write a program that changes the display based on if the touch sensor is pressed or […]

12. Debugging

12.1. Data Wires A Data Wire allows you to take an output from one programming block and input it into another. 12.2. Debugging techniques – Button press – Light – Sound – Display Debugging is a useful strategy to figure out where in your program something is going wrong or what went wrong Once your […]

13. Proportional Control

Blindfold one teammate. He or She has to get across the room as quickly as they can and stop exactly on a line drawn on the ground The rest of the team has to give the commands. When your teammate is far away, the blindfolded person must move fast and take big steps. But as […]

14. Introduction to MY BLOCKS

Whenever the robot is going to repeat an action inside your program When code is repeated in a different program Organize and simplify your code 14.1. When to use My Blocks 14.2. Parametrization of My Blocks Parametrization, also spelled parameterization is the process of defining or choosing parameters. Question: Look at the list of three […]

15. Parallel Beams

Parallel beams allow you to run two or more blocks at the same time. What if you have one or more attachment arms connected to motors and you want to turn these arms while the robot is moving to complete a mission. 15.1. How Do I Make a Parallel Beam? To create a parallel beam […]

16. Logic Operations & Decision Making

– The Logic Bock does a Logic operation on its inputs, and outputs the result – A Logic Block takes inputs that are True or False, and produces a True or False output – Logic values can be used as inputs into loop exists and switch conditions. – It is found in the Red Programming […]

17. Data Logging

The EV3 software provides a simple way to continuously record sensor readings to a file and to plot the values later. This is called Data Logging. Why use Data Logging: – science experiments. – understanding robot programming blocks. – understanding sensor behavior. Autonomous Data Logging requires the Data Logging Block 17.1. How do you use […]

18. Introduction to Bluetooth

Bluetooth uses radio frequencies to communicate between devices The EV3 uses Bluetooth to download programs wirelessly The EV3 also uses Bluetooth to connect to another EV3: – Have them perform similar actions – Synchronize their actions Tips for Success Give each brick an unique name (Sender and Receiver for this lesson) Use an USB cable […]


Lesson 3 C1: C2: Lesson 5 C1: You probably used a combination of move steering to go straight and do pivot turns to go around the box. C2: You probably used a spin turn because it is better for tighter turns and gets you closer to the starting point! Lesson 6 C1+C2: Lesson 8 C1: […]