top of page

Learning lego programming

The EV3 Mindstorm software and the WeDo software both go over what certain programming blocks mean. Confused? I was too. No worries. In case you are struggling, I have descriptions of what the most important programming blocks do and how to use them.

Programming for the WeDo

Flow Blocks:

Start Block

The start block plays your program when clicked. It should always be at the beginning of your program.

Screen%20Shot%202020-03-31%20at%205.21_e
Wait For Block

This block tells the program to wait for something to happen (1 sec. in this case), but you can also make it wait for a sensor to sense something. Don't forget to put something in the bottom box.

Screen%20Shot%202020-04-01%20at%202.14_e
Repeat Block

You can place other blocks inside of the repeat block, and they will run forever. They can also run a certain amount of times and you can change this by clicking on the repeat block.

Screen%20Shot%202020-04-01%20at%202.14_e

Place blocks inside here

Motor Blocks:

Rotate motor to the left
Screen%20Shot%202020-03-31%20at%205.22_e

This block tells the motor to turn to a specific direction (the left in this case). Tapping the block will change the direction of which way the motor will turn.

Motor power 

This block tells the motor how fast it should run. You can out in a number from 1-10 in the bottom box. 

Screen%20Shot%202020-03-31%20at%205.21_e

Level of power input

Motor for a set time

This block runs the motor for a specific amount of time which you enter in seconds. 

Screen%20Shot%202020-03-31%20at%205.21_e

# of seconds

Motor off

This block stops the motor from running completely.

Screen%20Shot%202020-03-31%20at%205.21_e

Hub Blocks:

Light Block

This block turns the light on the hub a different color. You can input a number from 1-10 which each correspond to different colors.

Screen%20Shot%202020-03-31%20at%205.22_e

Type of color

Sound Block

This block plays a sound that you can chose from a list of sounds available already using a number input. If you chose number 0, you are able to record your own sound!

Sound input

Screen%20Shot%202020-03-31%20at%205.22_e

Sensor Blocks:

Distance Change 

This uses the motion sensor to measure whether the distance changes. If you click on the block, you can change it to when the distance gets bigger or gets smaller.

Screen%20Shot%202020-04-01%20at%202.14_e
Shake/Tilt

This block refers to the tilt sensor and measure if the sensor has been shaken or not. If you click on this block, it can also change to measure if the sensor is titled in a specific direction

Screen%20Shot%202020-04-01%20at%202.14_e

Programming for the EV3

Flow Blocks:

EV3 has a start, wait for, and repeat block just like the WeDo. Scroll up to see what they do. 

Motor Blocks:

Move medium motor

This moves the medium motor. You put in what speed you want the motor to move, how many rotations you want the motor to make, and the letter of the port that has the wire connected to the motor

Power

# of rotations

Screen%20Shot%202020-04-01%20at%202.56_e

Motor port

Move large motor

This block works the same as the medium motor, except it just moves the large motor. You still have to input all the same info as before

Power

# of rotations

Screen%20Shot%202020-04-01%20at%202.56_e
Steer

This block will move 2 large motors at a time. For this block, you still have to put the power and rotation, but you also have to input what general direction you want the robot to go. 

Direction

Power

Screen%20Shot%202020-04-01%20at%202.56_e

# of rotations

Move Tank

This is similar to the steer block because it moves 2 large motors at a time, but for this block, you do not specify direction, you specify the power of each motor. If one motor is going faster than the other, the robot will turn

Power of motor 1

Power of motor 2

Screen%20Shot%202020-04-01%20at%202.56_e

# of rotations

Brick Blocks:

Display

This block can change what you see on your brick screen. You can make it have a smile or a frown. Click on the white box in the top right corner to choose what image you want 

Screen%20Shot%202020-04-01%20at%202.57_e

check=erase

X=keep

Image

Brick lights

This block changes the lights of the arrow on your EV3 brick. Choose your color by entering a number

Screen%20Shot%202020-04-01%20at%202.57_e

Color

Sound

This block plays any sound you want. You can make it say "Hello." Click the white box in the top right corner to choose your sound.

Screen%2520Shot%25202020-04-01%2520at%25

sound

Volume

If you want it to repeat

Sensor Blocks:

The EV3 kit's touch sensor and gyro sensor function the same as the touch sensor and gyro sensor from the WeDo, except with this gyro sensor you get to put in an exact angle. The ultrasonic sensor is also programmed the same as the distance sensor from the WeDo. Scroll up to learn how to use them. 

Color sensor

This block will tell the color sensor what amount of light or what color it should look out for. Just select you color.

What you want measured or compared

Screen%20Shot%202020-04-02%20at%2012.33_

Color to sense

bottom of page