12
EV3 Programming

EV3 Programming - Unified Robotics

  • Upload
    others

  • View
    22

  • Download
    0

Embed Size (px)

Citation preview

Page 1: EV3 Programming - Unified Robotics

EV3 Programming

Page 2: EV3 Programming - Unified Robotics

Software Used: Ev3 Education

Edition

Can be downloaded here:

https://education.lego.com/en-us/downloads/mindstorms-ev3/software

Page 3: EV3 Programming - Unified Robotics

Creating a New File

Got to file in the upper left-hand corner, hover over new project, and select program. A new window named “Project” should pop up.

Page 4: EV3 Programming - Unified Robotics

Programming Basics

• At the bottom of the screen are colored tabs that represent different categories of code blocks.

• By default, the program is open on the green tab of code blocks, which are the “Action” blocks.

Page 5: EV3 Programming - Unified Robotics

Action

• In the middle of the green section are the 2 “Move” blocks: Move Steering and Move Tank, which both use motor ports B and C on the brick.

• Move Steering

• Move Tank

Move Steering

MoveTank

Large Motor

MediumMotor

Display Sound BrickStatusLight

Page 6: EV3 Programming - Unified Robotics

Block Properties

Number of RotationsFrom motors (exclusiveTo On for Rotations)

Power (1-100)

Direction of Steering

Turning setting(On,On for SecondsOn for DegreesOn for Rotations)

Left Power

Right Power

Number of RotationsFrom motors (exclusiveTo On for Rotations)

Page 7: EV3 Programming - Unified Robotics

Simple Program Example

• This program will make the robot go forward 10 rotations, turn for one rotation, and then go 10 more rotations.

Page 8: EV3 Programming - Unified Robotics

Sensors

BrickButtons

ColorSensor

GyroSensor

MotorRotation

Timer TouchSensor

UltrasonicSensor

Useful to have when you need to trigger an event

Page 9: EV3 Programming - Unified Robotics

Flow Control• This section contains

all the blocks for sequencing

• Loops are essential for making continuing programs

• Switches are used to allow two different outcomes. Can be determined directly by sensor input.

LoopWaitStart (inProgram bydefault)

Switch Loop Interrupt

Page 10: EV3 Programming - Unified Robotics

Switch Options

Here are the many options of triggering the switch, most of which have to do with sensors.

Page 11: EV3 Programming - Unified Robotics

Sample Switch and Loop Program

This program will move forward when

The ultrasonic sensor detects a distance less than 50 cm, and will stop otherwise.

Page 12: EV3 Programming - Unified Robotics

Have Fun Programming!