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.
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.
Repeat Block
Place blocks inside here
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.
Motor Blocks:
Rotate motor to the left
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
Level of power input
This block tells the motor how fast it should run. You can out in a number from 1-10 in the bottom box.
Motor for a set time
# of seconds
This block runs the motor for a specific amount of time which you enter in seconds.
Motor off
This block stops the motor from running completely.
Hub Blocks:
Light Block
Type of color
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.
Sound Block
Sound input
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!
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.
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
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
Power
# of rotations
Motor port
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
Move large motor
Power
# of rotations
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
Steer
Direction
Power
# of rotations
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.
Move Tank
Power of motor 1
Power of motor 2
# of rotations
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
Brick Blocks:
Display
check=erase
X=keep
Image
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
Brick lights
Color
This block changes the lights of the arrow on your EV3 brick. Choose your color by entering a number
Sound
sound
Volume
If you want it to repeat
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.
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
What you want measured or compared
Color to sense
This block will tell the color sensor what amount of light or what color it should look out for. Just select you color.