Download presentation
Presentation is loading. Please wait.
1
Lego MINDSTORMS EV3
2
Programming Basics You Need to Know
Loop Switch-Statement
3
Loop: The Basic Structure
Loop condition (when the loop will stop running) Code that will be repeated
4
Loop: Examples The Block of code that will be repeated in the loop
Timer Loop for 10 seconds Move Tank Block Move tank forward at power 30 for 2 seconds.
5
Turn at a power of 30 for 1 rotation of the wheels.
Loop: Examples Move Steering Block Turn at a power of 30 for 1 rotation of the wheels. Do while the gyro sensor does not measure a change of 90 degrees or more in the angle
6
Loop will run a total of 6 times
Loop: Examples Play Sound Block Bark like a dog Loop will run a total of 6 times
7
Switch-Statement: The Basic Structure
Condition statement Code that runs when condition statement is true Code that runs when condition statement is false
8
Switch-Statement: Examples
the robot will make a “cheering” sound If the color sensor measures an ambient light intensity of greater than 15, Else, the robot will make a “Boo” sound
9
Switch-Statement: Examples
the robot will make a “cheering” sound If the Gyro Sensor senses the robot turning at a rate of 90 degrees per second or faster, Else, the robot will make a “Boo” sound
10
Switch-Statement: Examples
the robot will say, “blue” If the color sensor measures an ambient light intensity of greater than 15, Else, the robot will say, “no blue”
11
Things You Will Be Working With:
Sensors Motors Color Sensor Touch Sensor (2) Ultrasonic Sensor Gyro Sensor Large Motors (2) Medium Motor
12
Sensors: Color Sensor
13
Sensors: Color Sensor Color Mode Black Blue Green Yellow Red White
Brown No Color
14
Sensors: Color Sensor Reflected Light Intensity Mode
Measures how intensity of light reflected back from an object 0 (very dark) (very light)
15
Sensors: Color Sensor Ambient Light Intensity Mode
Measures intensity of light coming from the environment around it 0 (very dark) (very light)
16
Sensors: Touch Sensor
17
Boolean Value (TRUE or FALSE, 1 or 0)
Sensors: Touch Sensor Pressed Released Bumped Boolean Value (TRUE or FALSE, 1 or 0)
18
Ultrasonic Sensor
19
The Ultrasonic Sensor can measure distances in
Centimeters or Inches This part contains the value that the sensor read. It can be dragged to blocks in which you need that value.
20
Ultrasonic Sensor Compare Distance
21
Gyro Sensor
22
Gyro Sensor The Gyro Sensor can measure the change in direction the robot is facing from the last time the sensor was reset.
23
Gyro Sensor It can measure the angle that the robot has turned and the rate at which the robot is turning.
24
Gyro Sensor It can also compare angles and rates with values that you choose
25
Gyro Sensor It can also be reset with one simple block of code.
26
Motors Large Motor (2) Medium Motor
27
Motors Large Motor (2) Medium Motor
Built-in Rotation Sensor with 1- degree resolution Programmable Used for the movement and steering of the robot Large Motors can be controlled together or individually Built-in Sensor with 1-degree resolution Programmable Lighter than Large Motor, responds more quickly
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.