What Is a Program? Pre-Quiz

Similar documents
Loops and Switches Pre-Quiz

Loops and Switches Pre-Quiz

EV3 Programming Workshop for FLL Coaches

Lab1: Introductory and Setup Activities

Module 2, Add on lesson Introduction to the NXT and Mindstorms software. Student. 45 minutes

Part A: Monitoring the Rotational Sensors of the Motor

lab A.3: introduction to RoboLab vocabulary materials cc30.03 Brooklyn College, CUNY c 2006 Name: RoboLab communication tower canvas icon

ROBOLAB Tutorial MAE 1170, Fall 2009

Module 2, Add on lesson Introduction to the NXT and Mindstorms software. Teacher. 45 minutes

Tutorial: Making Legobot Move Steering Command Brighton H.S Engineering By: Matthew Jourden

Programming with the NXT using the touch and ultrasonic sensors. To be used with the activity of the How do Human Sensors Work?

Robotics II. Module 5: Creating Custom Made Blocks (My Blocks)

Technical Learning. To Get Started. 1. Follow the directions in the Constructopedia to build Robo 1.

Introduction to Robotics using Lego Mindstorms EV3

Discover Robotics & Programming CURRICULUM SAMPLE

PowerPoint for Art History Presentations

Ancient Cell Phone Tracing an Object and Drawing with Layers

Robotics II. Module 1: Introduction to Data & Advanced Programming Blocks

Don t Bump into Me! Pre-Quiz

EV3Dev Lessons. Introduction to EV3Dev: Setup with Python

Robotics Study Material School Level 1 Semester 2

Autonomous Parking. LEGOeducation.com/MINDSTORMS. Duration Minutes. Learning Objectives Students will: Di culty Beginner

the NXT-G programming environment

Get comfortable using computers

WINDOWS 8 CHEAT SHEET

Robotics II. Module 3: Dealing with Files

Introduction to Computers By Jennifer King, YA and Marketing Librarian, Great Bend Public Library

Robotics 2c. The Programming Interface

Finding the Volume of Solids

LME Software Block Quick Reference 1. Common Palette

Block Programming Guide

Teacher Cheat Sheet - Game Coding Challenges

G5-20 Introduction to Slides

Programming Techniques Workshop for Mindstorms EV3. Opening doors to the worlds of science and technology for Oregon s youth

EduRob EV3 Technical User Guide

Google SketchUp Design Exercise 1

In groups take a Mindstorms kit and decide on what sort of chassis will work best.

Download Program. Setup ROBOTC. task main() { motor[motorc] = 100; wait1msec(3000);

This page outlines some of the alternate pieces that can be used for building.

Learning to use the drawing tools

SOLIDWORKS: Lesson 1 - Basics and Modeling. Introduction to Robotics

Anatomy of a Window (Windows 7, Office 2010)

Part II: Creating Visio Drawings

Computer Basics. Need more help? What s in this guide? Types of computers and basic parts. Why learn to use a computer?

COMPUTER DESCRIPTION...

Pixie 2 Tutorial. The Toolbar: The toolbar contains buttons for the most common functions in Pixie.

Adobe Illustrator. Always NAME your project file. It should be specific to you and the project you are working on.

Tech Tips. BeeBots. WeDo

Robotics II. Module 2: Application of Data Programming Blocks

INTERMEDIATE PROGRAMMING LESSON

Robolab. Table of Contents. St. Mary s School, Panama. Robotics. Ch. 5: Robolab, by: Ernesto E. Angulo J.

MD5-26 Stacking Blocks Pages

Let s Make a Front Panel using FrontCAD

Polygons and Angles: Student Guide

S3 Scratch Programming

Creative Sewing Machines Workbook based on BERNINA Embroidery Software V8.1

What is OneNote? The first time you start OneNote, it asks you to sign in. Sign in with your personal Microsoft account.

Adobe Flash CS3 Reference Flash CS3 Application Window

AAG Mobile App User Manual

Robotics II. Module 4: Bluetooth Communication

i wonder, therefore i am. Welcome to the Wonder League! This packet includes everything you need to know about Dash, Dot, and how to get started!

POWERPOINT BASICS: MICROSOFT OFFICE 2010

Creative Sewing Machines Workbook based on BERNINA Embroidery Software V8

INSERVICE DAY - 11/11/11 TECHNOLOGY

Relate volume to the operations of multiplication and addition and solve real world and mathematical problems involving volume. (5.MD.

Smoother Graphics Taking Control of Painting the Screen

Velocity: A Bat s Eye View of Velocity

EXCEL BASICS: MICROSOFT OFFICE 2010

RLanglois ScanPro 3000 High Definition Microfilm Scanner Help Guide

OrbBasic Lesson 1 Goto and Variables: Student Guide

Physics 101, Lab 1: LINEAR KINEMATICS PREDICTION SHEET

OnPoint s Guide to MimioStudio 9

Lesson 5: Review and Deliver Presentations Microsoft PowerPoint 2016 IN THIS CHAPTER, YOU WILL LEARN HOW TO

EXCEL BASICS: MICROSOFT OFFICE 2007

Vision Pointer Tools

EdPy worksheets Student worksheets and activity sheets

Slide 2 / 222. Algebra II. Quadratic Functions

1.4 MULTIPLYING WHOLE NUMBER EXPRESSIONS

OrbBasic 1: Student Guide

SolidWorks 2½D Parts

Excel Tables and Pivot Tables

Customizing FlipCharts Promethean Module 2 (ActivInspire)

This lesson introduces Blender, covering the tools and concepts necessary to set up a minimal scene in virtual 3D space.

SketchUp Quick Start For Surveyors

PowerPoint Module 2: Modifying a Presentation

Part A: Monitoring the Touch Sensor and Ultrasonic Sensor

SolidWorks Intro Part 1b

This course will introduce the user to a Mobi and the Workspace software. This tool allows the instructor to annotate and work alongside of the

THE SHADE STORE MOTORS WITH AMAZON ALEXA

Quilt Maker Pro 18 PRO STITCHER SOFTWARE QUICK REFERENCE GUIDE. Janome America

Collaborate Ultra: Sharing Content

Basic Computer and Mouse Skills Windows 10

INTERMEDIATE PROGRAMMING LESSON

Adobe PageMaker Tutorial

Essential Skills in ICT. Level 1. Guidebook

Mastering Truspace 7

Part 1: Basics. Page Sorter:

Taking Apart Numbers and Shapes

3Dream Training Guide version 5.1

When you first start OneNote, it creates a sample notebook for you. You can use this notebook or quickly create your own.

Transcription:

What Is a Program?

What Is a Program? Pre-Quiz 1. What is a program? 2. What is an algorithm? Give an example. 2

What Is a Program? Pre-Quiz Answers 1. What is a program? A program is a sequence of instructions written to direct a computer to perform a task. 2. What is an algorithm? Give an example. An algorithm is a clear and specific procedure for solving a problem in a finite number of steps. Example: The addition algorithm is a procedure for how to add any two numbers. 3

What is a program? In today s world, computers are everywhere! They are capable of running all sorts of programs to perform a huge variety of tasks. Just think about all the applications (apps) that are available for smart phones and tablets. They can do everything from playing chess to setting alarms to enhancing pictures. Each app is a program designed to perform a specific task. As computers become even more widespread, the ability for people like you to be able to program becomes more and more important. Programming is how you tell a computer how to perform a task that you want it to do. Objective In today s lesson, we: Investigate programs and algorithms What are they? Become familiar with simple commands that are used in programs Learn how to use LEGO MINDSTORMS EV3 software to write programs that the LEGO robot can execute 4

What is a program? A program is a sequence of instructions written to direct a computer to perform a task. All computers can run programs. Example: A calculator is a computer that is programmed to perform arithmetic operations. Similarly, the LEGO MINDSTORMS EV3 intelligent brick is a computer that we can program to perform different tasks, such as moving through a maze. 5

What is an algorithm? An algorithm is a clear and specific procedure for solving a problem in a finite number of steps. Example: Addition algorithm: A systematic process that always produces the correct answer when numbers are to be added. 1 1 1 2 3 + 7 8 9 9 1 2 6

What is Programming? Programming is designing an algorithm to solve a problem. You need to have commands that are clear and precise the robot will follow them exactly, so each step is important. 7

Mini-Activity: Programming as an Algorithm Using a roll of tape, make a short maze on the floor in the corner of the room resembling this diagram Blindfold a volunteer robot and have him/her stand at the start of the maze, hands at his/her sides. Have another student the programmer give a series of commands (such as, go forward 2 steps, turn right, etc.) to instruct the volunteer to complete the maze. wall (10 minutes) end 6 ft wall 3 ft 6 ft start 8

Mini-Activity: Programming as an Algorithm Observations and Questions: Did the programmer get the blindfolded robot through the maze? (continued) Did the commander always tell the robot to go the correct number of steps? Often, it is easier for the programmer to give instructions if s/he can tell the robot to go forward until s/he senses something. Why? This way, the programmer does not have to worry about telling the robot exactly how many steps to move forward. 9

Mini-Activity: Programming as an Algorithm Choose a new volunteer to be blindfolded. This time, permit the volunteer robot to stretch out his hands in front of his body to sense when he is approaching a wall. wall Have another student give commands to instruct the volunteer to get through the maze. (continued) end wall Now, commands such as go forward until you hit a wall are permitted. 6 ft 3 ft 6 ft start 10

Mini-Activity: Programming as an Algorithm (continued) Was it easier to give instructions the first time or second time? It is generally easier to tell a robot to go forward until it senses something (such as a wall) than to tell it exactly how far it should go before it turns. 11

Mini-Activity: Programming as an Algorithm (continued) Note that the volunteer had to be told everything, that is, which direction s/he should move in, how long to move in that direction, how much to turn, etc. The LEGO EV3 robot needs to be given exactly the same information. It knows nothing and is blind and will do exactly what you tell it to do. If you make an error in programming, the EV3 won t do what you want. 12

Quick Programming Using the EV3 Brick We can program a robot to do some simple tasks just by using the LEGO EV3 brick because the brick is a small computer. To turn on the brick, press the center button Then select Right button twice to the Brick Apps screen and select Brick Program App To choose block, use the Up button to see the Block Palette 13

Quick Programming Using the EV3 Brick (continued) Do This: Let s program the robot to move forward for 5 seconds, then wait 2 seconds, turn right for 2 seconds, wait for 5 seconds, and then stop. Select the Forward 5 block. Then use the arrows to scroll to the Wait 2 block and select it. Now scroll over to the Right 2 block and select it. Scroll over to the Wait 5 block and select it. Scroll over to the Stop block and select it. Scroll over to Start block at the very beginning of the program and press the center button. 14

Quick Programming Using the EV3 Brick (continued) Do This: Press the up button to the block palette until you have cleared the 5 slots of the EV3 Program. Select different blocks and make your own quick programs on the EV3 brick. 15

Quick Programming Using the EV3 Drawbacks Programming directly on the EV3 brick is a convenient way to make simple programs and it is helpful to know the different features of the EV3 brick. However, this method of programming is not very efficient and won t work for everything we want to do, for the following the reasons: The EV3 brick only provides a small set of commands and durations (timing choices) for programming. The EV3 brick can only make programs that are a maximum of 5 blocks long. 16

Quick Programming Using the EV3 Drawbacks (continued) It is not even possible to complete the maze you worked through in the activity by programming on the EV3 brick. So, from this point forward, we will use LEGO MINSTORMS EV3 software. This software enables us to: make longer programs use more sophisticated commands have control over the fine details of the program 17

DAY 2 18

Getting Started with MINDSTORMS Open the MINDSTORMS software by clicking on the start menu. A window should open, looking like the one below. 19

Getting Started with MINDSTORMS (continued) Move the cursor inside the dialogue box next to + and create a new program. Create a Program 20

Getting Started with MINDSTORMS (continued) Your screen should now resemble the image below. This is the workspace you will use to create your programs. 21

Getting Started with MINDSTORMS (continued) The square icons on the bottom of the screen represent different blocks that can be used for programming. In this lesson, we will be using only the move block. Programming Area The Communication Pane Connection status Download programs ready to be run Download/play programs instantly Download a section of a program to run Intelligent EV3 Brick status: name and battery level, etc. Port status and sensor readings Type of connection between the EV3 Brick and the computer (BT, Wi-Fi, or USB) Programming Blocks in 6 Colored Tabs Brick Status & Downloading 22

The Move Block Move your cursor over the move block icon. Click and drag the move block into the start square When you are done, the top left quarter of your screen should resemble the image shown below The move block in your program should be highlighted in a thin light blue outline. If it is not, highlight the block by clicking on it. 23

The Move Block: Port A move block is used to control one or more motors. You will rarely need to change the Port settings. 24

The Move Block: Power Power controls how fast the motors turn and which way the motors are set to rotate. The positive sign means forwards, the negative sign means backwards. Increasing or decreasing the power too much tends to decrease the consistency of the motor movement, so it is recommended that 75 is used, unless there is a good reason to change it. 25

The Move Block: Steering Steering allows us to easily make the robot turn. Dragging the pointer to the left makes the robot turn left Dragging it to the right makes the robot turn right The farther to one side the pointer is dragged, the sharper the turn will be If the pointer is dragged all the way to one side, the robot should turn in place 26

The Move Block: Duration Duration controls how long the motors rotate. Clicking the dropdown arrow, reveals several options. Seconds allows you to control the length of time the motors turn for. Degrees allows you to control precisely how many degrees the motor spins, where 360 is one rotation of the motor. Rotations allows you to control how many times the motor spins. (1 rotation = 1 full spin) 27

The Move Block: Duration (continued) Rotations is generally preferred over Degrees/Seconds because: We generally need to make the robot move a few rotations in a direction and 3 rotations is much less tedious to type than 3*360 degrees = 1080 degrees. Depending on factors such as the power setting and the amount of battery charge, the motors can spin different amounts of time in a second. But a motor spinning 1 rotation should always spin exactly the same amount. 28

The Move Block: Next Action You will almost never need to use the Next Action option It simply controls whether the motors are locked after performing a command or not This option matters if the robot is on a steep incline. Brake prevents the robot from rolling back down after it executes a command Coast allows the motors to be turned by gravity 29

Move Block: Helpful Hints The robots are not perfectly consistent or alike but generally: For every 1 rotation forward, the robot moves about 7 inches. Pulling the steering pointer all the way in one direction and setting duration to.5 rotations produces a turn that is close to 90 30

Example Program Program the robot to follow the track shown below. Start by breaking this track down into steps: 1. Move forward for 2 feet 2. Turn left 3. Move forward for 1 foot end 1 ft start 2 ft 31

Part 1: Move forward for 2 feet First, we drag a move block into the program. Now we know we are moving straight forward. So this means, that we want to keep the upwards arrow selected. Next, we have to decide what to do about the steering. Since the robot is moving straight forward, we do not want the robot to turn at all, so we do not need to change the steering. Finally, we need to determine the duration: In Helpful Hints, we learned that 1 rotation is about 7 inches 1 ft = 12 inches, so 2 ft = 24 inches 24 inches divided by 7 inches 3.5 So to go 2 ft, we need to go about 3.5 rotations 32

Part 1: Move Forward for 2 feet (continued) So far, the program should look like this: 33

Part 2: Turn Left end 1 ft 2 ft We want the robot to turn left next, so drag another move block down and set it next to the first one. Since the turn forms a rectangular corner, it is a 90 turn. Recall from helpful hints that we said moving the steering pointer all the way to one direction for a duration of.5 rotations gets us close to a 90 turn. So keeping the direction forward (the robot is moving forward as it turns), pull the steering pointer all the way to the left, and set duration to 0.5 rotations. start 34

Part 2: Turn Left (continued) So far, the program should look like this. The second move block is highlighted, and the details are shown below. 35

Part 3: Move Forward for 1 Foot Just as in Part 1, the robot is moving straight forward, so we do not need to change direction or steering. We do need to figure out the duration again. This time, the robot should move 1 foot, or 12 inches forward. Remember 1 rotation is about 7 inches. So 12 inches divided by 7 inches 1.75 So let s set the duration to 1.75 rotations 36

Part 3: Move Forward for 1 Foot (continued) The complete program should look like this, with the details of the highlighted third block shown below. 37

Downloading the Program onto the EV3 Now it s time to download the program onto your EV3: Do This: Plug one end of the USB connecting cable into the computer, the other into the EV3 Make sure both ends are fully inserted Turn on the EV3 by pressing the center button Look for this set of buttons in the bottom right corner of your computer screen To download the program, click on the down arrow Then press the center button until the program starts running 38

What Is a Program? Post-Quiz 1. What is a program? 2. What is an algorithm? Give an example. 39

What Is a Program? Post-Quiz Answers 1. What is a program? A program is a sequence of instructions written to direct a computer to perform a task. 2. What is an algorithm? Give an example. An algorithm is a clear and specific procedure for solving a problem in a finite number of steps. Example: The addition algorithm is a procedure for how to add any two numbers. 40

Vocabulary program: A sequence of instructions written to direct a computer to perform a task. algorithm: A clear and specific procedure for solving a problem in a finite number of steps. 41

Images Sources Slide 1: Girl looking at laptop monitor; source: Microsoft clipart: http://office.microsoft.com/enus/images/results.aspx?qu=computer&ex=1#ai:mp900430487 Slide 8: Girl blindfolded in trust game; source: 2005 Tracee L. Jackson, U.S. Marine Corps via Wikimedia Commons: http://commons.wikimedia.org/wiki/file:blindfoldlowres.gif Slides 10, 11: Blindfolded kids in trees; source: North Carolina State Parks: http://www.ncparks.gov/visit/parks/hari/pics/harp_maze.jpg Slide 9: Maze line drawing; source: 2005 ZeroOne, Wikimedia Commons: http://commons.wikimedia.org/wiki/file:maze01-01.png Slide 15, 39: Girl on floor with laptop and hands raised; http://office.microsoft.com/enus/images/results.aspx?qu=computer&ex=1#ai:mp900448599 Slide 18: men s feet stepping: source: Microsoft clipart: http://office.microsoft.com/enus/images/results.aspx?qu=feet&ex=1#ai:mp900425511 Device and programming images from LEGO MINDSTORM EV3 User s Guide http://goo.gl/wuhsua Screen captures and diagrams by author 42