Looping forever Reading/observing sensors (inputs) Reacting to sensors Obstacle sensors.

Slides:



Advertisements
Similar presentations
Getting Started with PowerPoint
Advertisements

Working with Profiles in IX1D v 3 – A Tutorial © 2006 Interpex Limited All rights reserved Version 1.0.
Jason Howard. Agenda I. How to download robotc II. What is tele-op used for? III. How to build a basic tele-op program IV. Getting the robot to drive.
Introduction to Excel Formulas, Functions and References.
 Use the Left and Right arrow keys or the Page Up and Page Down keys to move between the pages. You can also click on the pages to move forward.  To.
Overview Lesson 1. Objectives Step-by-Step: Start Excel 1.Click the Start menu, and then click All Programs. 2.On the list of programs, click Microsoft.
COMPUTER PROGRAMMING I Essential Standard 5.02 Understand Breakpoint, Watch Window, and Try And Catch to Find Errors.
CREATING A MULTIPLE PAGE REPORT Presented by: Dr. Ennis-Cole.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
Mrs. Chapman. Tabs (Block Categories) Commands Available to use Script Area where you type your code Sprite Stage All sprites in this project.
ENGR 101: Robotics Lecture 1 – Introduction Outline  The Scribbler's Sensors  Demo Modes  Graphical Programming References 
Calvin and Hobbes Teach Properties and Functions Created by Daniel MacDonald under the direction of Professor Susan Rodger Duke University June 2013.
Mr. Wortzman. Tabs (Block Categories) Available Blocks Script Area Sprite Stage All sprites in this project.
Introduction to VBA. This is not Introduction to Excel We’re going to assume you have a basic level of familiarity with Excel If you don’t, or you need.
Information guide.
1 iSee Player Tutorial Using the Forest Biomass Accumulation Model as an Example ( Tutorial Developed by: (
MICROSOFT WORD GETTING STARTED WITH WORD. CONTENTS 1.STARTING THE PROGRAMSTARTING THE PROGRAM 2.BASIC TEXT EDITINGBASIC TEXT EDITING 3.SAVING A DOCUMENTSAVING.
Spreadsheets in Finance and Forecasting Presentation 9 Macros.
Today’s Agenda 1.Scribbler Program Assignment 1.Project idea due next class 2.Program demonstration due Wednesday, June 3 2.Attendance & lab pair groupings.
INTEGRATION TO GENERATE MOTIVATION TO LEARN INTEGRATION TO FOSTER CREATIVITY.
Collecting Things Together - Lists 1. We’ve seen that Python can store things in memory and retrieve, using names. Sometime we want to store a bunch of.
Working with the VB IDE. Running a Program u Clicking the”start” tool begins the program u The “break” tool pauses a program in mid-execution u The “end”
Motors and Sound Troubleshooting Tips. © H-CCS Problem 1 Why can’t I download my program to the RCX?
Build-It-Yourself.com BLENDER 3D LESSON 3 BLENDER 3D LESSON 3.
Robotics NXT-G: variables, file Rotation sensor Lab: Use buttons to hit specific ball. Homework: Postings. Start planning mapping the room.
Steps for posting a training (single event or series) to the regional calendar R&C Regional Calendar.
1 2 Left Click 3 Left Click 4 Left Click NOTE: Your screen may look different; however, find the Start button (lower left corner); then All Programs; ending.
Learning PowerPoint Presenting your ideas as a slide show… …on the computer!
Adding a wave file to a slide Adding a wave file to a slide (1 of 7) 1. Click on Insert. 2. Click Movies and Sounds. 3. Click Sound from file
Overview Lesson 1 Miami Beach Senior High School Academy of Information Technology 1.
Introduction to Computer Programming - Project 2 Intro to Digital Technology.
Extracting Information from an Excel List The purpose of creating a database, or list in Excel, is to be able to manipulate the data elements in ways that.
screen shots Emma Jarman. Adding attachments What is an attachment? An attachment is an that has a file attached to it. The file could be.
AVCE ICT – Unit 7 - Programming Session 12 - Debugging.
Software Design– Unit Testing SIMPLE PRIMER ON Junit Junit is a free simple library that is added to Eclipse to all automated unit tests. The first step,
SNIPING TUTORIAL – BY TMAN THE IDEA: The objective of this tutorial is to create a sniping effect. To create the sniping effect you need to create a scope.
Introduction to Programming Python Lab 8: Loops 26 February PythonLab8 lecture slides.ppt Ping Brennan
Casne.ncl.ac.uk Taking care of the CrumbleBot Please do NOT stress the robot's motors 1.Do NOT push the robot 2.Do NOT hold the.
PLC programming Part 3: Problems with solutions. Topics  Every problem is devided into three parts:  Technology description contains the general properties.
1 ©2006 INSciTE Lab Three Task: Move forward for 2 feet, turn right 90º repeat to complete a square path. End up exactly where you started.
Game Maker Tutorials Introduction Clickball IntroductionClickball Where is it? Shooting Where is it?Shooting.
© 2006 Carnegie Mellon Robotics Academy Designed for use with the LEGO MINDSTORMS ® Education NXT Software and Base Set #9797 Sentry System Two-Way Communication.
Python Programming Module 4 Sensors and Loops Python Programming, 2/e1.
Welcome to the Basic Microsoft Word Guide. Before you start this Guide, you will need to complete “Basic Computer”; “Basic Windows” and know how to type.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
Reading & Writing Decimals
Significant Figures-Pt 1
Going Green By Ima Librarian
Static picture effects for PowerPoint slides
Stop Light Lab 7 Winter Quarter.
Tutorial for using Case It for bioinformatics analyses
ADDING COMMENTS TO AN EXCEL WORKSHEET.
What does learning look like?
MS PowerPoint 2010 Week 2.
Static picture effects for PowerPoint slides
Sensors and Logic Switches
Attitude toward quality and safety in health care:
TAB ONE TAB TWO TAB THREE TAB FOUR TAB FIVE
NUMBER CHARACTERISTICS How to Find a Special Number
CTAERN/DOE System Level Counselor Coordinator Profile Entry Initiative
Line Following Behavior
3 1 2 Significant Figures with calculations (Advanced)
Using the sensor Lesson 5.
CTAERN/DOE System Level Counselor Coordinator Profile Entry Initiative
transparent overlapping overlapping Overlapping, transparent text
A few tricks to take you beyond the basics of Microsoft Office
creating a ecosystems model in net logo
Oregon Robotics Tournament and Outreach Program
Objective of the lesson
Digital Mapping Welcome to a short presentation on how to create a very basic event route using digital mapping. In this example, we will be using Quo.
Presentation transcript:

Looping forever Reading/observing sensors (inputs) Reacting to sensors Obstacle sensors

Learning objectives: 1. Introduce the forever loop. 2. Introduce ifs.

Looping forever Repeats whatever is inside of the loop forever. (It can also optionally repeat something a specific number of times.)

Looping forever What does this program do?

Looping forever 1. Remove the first pause and run it. Q1: What do you observe? 2. Put the first pause back in and remove the second one. Run it. Q2: What do you observe? 3. Remove all pauses. Run it. Q3: What do you observe? 4. Using the Scribbler programming GUI, remove the start of the forever loop. Don’t run it! Q4: What happened (when you removed the start of the forever loop)?

Program P1: Artificial Life Program P1 artificial life (?) Write a Scribbler program that does the following: 1. Move the Scribbler forward for about ¼ second. 2. Pause for about one second. It should repeat this sequence of operations forever. You should also cause one or more of the LEDs to turn on and off (sort of like a heartbeat) as well. Send a screen shot and the.scb file to me.

What can we read/observe? 1. Line sensors 2. Obstacle sensors 3. Crash (stall) 4. Light sensors 5. Coin toss

What can we read/observe? Obstacle sensors: 1. Left 2. Right

IF - ELSE 1. Observe a sensor. 2. Conditional tiles are used to create a fork in the road of your program's execution. 3. Depending on the outcome of the chosen condition, your program may continue in one of two different directions (but not both).

IF - ELSE The simplest conditional is the IF-THEN- ELSE tile (yellow). This tile checks for the presence of an obstruction on the left and none on the right. If this condition is met the path indicated by the green check mark is taken. If not, the path indicated by the red "X" is taken. So, overall, what this particular program does is turn the left LED on if there's a left obstruction and not a right one, and turns it off otherwise.

IF - ELSE Conditionals are inserted into your program the same as other tiles. Just click on the conditional button and a cursor will appear as you mouse over the worksheet, showing you where the conditional can be inserted. When you click it into place, the conditional edit box will appear, as shown to the left.

IF - ELSE Here you can select what condition you want to test by clicking one of the five multiple-choice boxes until that condition appears.

IF - ELSE For most conditions, the slider at the bottom can be used to place further restrictions on when the condition is TRUE, such as a required number of consecutive observations of that condition.

IF - ELSE The remaining button is used to switch the TRUE and FALSE directions. Notice that the reversed directions are highlighted in black to make them more obvious in your program.

IF - ELSE When a conditional is placed, it creates several locations where additional tiles may be inserted.

IF - ELSE When a conditional is placed, it creates several locations where additional tiles may be inserted. One is immediately to the bottom of the tile and is normally the program fork corresponding to a TRUE condition.

IF - ELSE When a conditional is placed, it creates several locations where additional tiles may be inserted. Another insertion point is the arrow to the right of the tile. This is normally the path taken by the FALSE condition.

IF - ELSE When a conditional is placed, it creates several locations where additional tiles may be inserted. A third insertion point is the arrow below the conditional tile. This occurs where the forking program paths rejoin. A tile place here will execute regardless of whether the condition was TRUE or FALSE.

ELSE - IF There is yet another insertion point available only if you happen to be inserting another conditional tile. It's just to the right of the conditional tile and is indicated by a vertical cursor.

ELSE - IF By inserting additional conditionals in this fashion, you can create multi-way branching in your program, as the example illustrates. Here, all possible obstruction conditions are being tested with a motion response for each one. Notice that the last condition (no obstruction) doesn't need an explicit test, since it will be the one that's TRUE if, and only if, the other three are FALSE.

What can we read/observe? Obstacle sensors

Obstacle sensor condition The obstacle sensor uses the two infrared LEDs on the left- and right-front of the Scribbler, along with the IR detector in the middle-front to detect light reflected from obstacles in its path. Each of the four possible combinations of left and right obstacles represents a separate condition. You can also restrict how many consecutive times the condition must be observed for it to be TRUE. In the example above, the condition of “left obstacle present and right obstacle absent” must hold for four or more successive observations for the condition to be TRUE.

Program P2: Fear Make a copy of program P1, and use it as the basis for P2. Add the following functionality: Read the obstacle sensors. Program the robot to react by moving away from the obstacle, if present (simulating fear). Q5: Experiment and determine the range (closest and farthest) of the obstacle sensors. Describe your experiment in a paragraph and report your results.

Lab assignment deliverables The Subject of your single must be: CSC 120 IF lab (I will deduct points if you fail to do this.) Include answers to questions Q1 through Q5. Include the P1.scb file and screen shot of P1. Include the P2.scb file and screen shot of P2.