Learning Outcomes Understand While Loop

Slides:



Advertisements
Similar presentations
Robofest 2005 Introduction to Programming RIS 2.0 RCX Code.
Advertisements

RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.
ROBOTC for CORTEX While Loops Part 1
Wait, sound sensor >70, Port 2 Flowchart – Heartbeat 1 Start Motor A, Move Backward, 1/3 Rotation, Power 20 Wait, 1 Second Sound Sensor (Port 2) Less than.
Automation and Robotics
Robot Programming. Programming Behaviors Behaviors describe the actions and decisions of your robot.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
©2006 CSUC Institute for Research in Intelligent Systems Introduction to Coding June 15, 2006.
Repeating Blocks of Code (updated 9/20/05 7:35pm) Reference NQC Tutorial pp 9-12.
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
LEGO Mindstorms NXT Programming We will be using the Common Palette for our Robots This is how you download your program onto the brick Drag and drop a.
New Mexico Computer Science For All More Looping in NetLogo Maureen Psaila-Dombrowski.
Testbed: Exercises.
Loops and Switches. 1. What kind of blocks are these? 2. Name two kinds of controls that can be specified to determine how long a loop repeats. 3. Give.
Robotics- Basic On/Off Control Considerations. On/Off Control Forms the basis of most robotics operations Is deceptively simple until the consequences.
GIRLS Robotic Camp. Let’s Begin Meet and Greet – Camp leaders introduce themselves – Students introduce themselves.
Programming 101 The Common Palette Content provided by Connor Statham (6 th Grade Student) Formatting by Shannon Sieber.
CSC Intro. to Computing Lecture 16: Robotran.
Getting Started! Lego Mindstorms Program NXT 2.0.
Robotics Overview of NXT-G Actuators in Mindstorms. Touch sensor Labwork: Right turn. Touch/bump. [Explore move versus Motor Move mini & motor mini. Motor*.]
Technical Writing for Robotic Coding!.  du/products/teaching_robotc_cort ex/fundamentals/introtoprogramm ing/thinking/videos/fundamentals.
2008 SBPLI/FIRST Programming Workshop Tom Boehm Patchogue Medford High School, Team 329 Motorola Inc. Mark McLeod Hauppauge High School Team 358 Northrop.
Sentry System Multiple Sensors
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4.
Photos and Sensor Instructions
LEGO® MINDSTORMS® NXT Move Block.
Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.
BEGINNER FLL PROGRAMMING WORKSHOP BY DROIDS ROBOTICS & EV3LESSONS.
Vex Robotics Program Two: Using two motors. Program two: using the motors In the last section, you learned how to turn on one motor. Now, you will take.
Deriving Consistency from LEGOs What we have learned in 6 years of FLL by Austin and Travis Schuh © 2005 Austin and Travis Schuh, all rights reserved.
Vex Robotics program three: using motors and sensors together.
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.
Testbed Coding In this activity you will code different challenges for the Testbed. For each challenge a sample program is shown. Use what this sample.
Forward Until Near Stop when near a wall.
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.
Testbed Coding In this activity you will code different challenges for the Testbed. For each challenge a sample program is shown. Use what this sample.
Decision Making: while loops and Boolean Logic. While Loops A while loop is a structure within ROBOTC which allows a section of code to be repeated as.
Sensor Information: while loops and Boolean Logic.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4.
LEGO Robotics Workshop
Sequencing Learning Objective: to be able to design algorithms that use sequencing.
Deriving Consistency from LEGOs
Module 2 Controlling a Lego EV3 Robot
By Sanjay and Arvind Seshan
Programming Part 2 Mod Kit
PROMGRAMING YOUR ROBOT
Gaming with conditionals
DT-Assessment Frame Work Term2
Loops and Switches Pre-Quiz
Make Decisions.
Automation and Robotics
Module F: Presentation Understanding Robot Fundamentals
Graph Paper Programming
Learning Outcomes List all Edison’s Sensors and actions
Graph Paper Programming
Beginner Programming Lesson
Line Following Behavior
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 5.
Repeating Behaviors.
Line Following Behavior
INTERMEDIATE PROGRAMMING LESSON
Which way does the robot have to turn to get to the charger?
Using a Drawing Robot to Make Angles (Using Rotations)
Photos and Sensor Instructions
Iteration Learning Objective: to be able to design algorithms that use iteration.
Loops and Switches How Do You Make Loops and Switches? lesson > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Using a Drawing Robot to Make Angles (Using Rotations)
Iteration Learning Objective: to be able to design algorithms that use iteration.
Learning Objective: to be able to design programs that use iteration.
Presentation transcript:

Learning Outcomes Understand While Loop Program Edison to move in any direction

Activity 1 – Drive in square shape

EdPy (Edison and Python) It’s a high level language was first released in 1991. http://www.edpyapp.com/

While Loop Loop : is to repeat the process over and over again While represent an infinite loop.

Activity 4 – Page 48 The program will repeat forever since you used a while loop and made the condition true.

Activity 5 – Page 49 #-------------Setup---------------- import Ed Ed.EdisonVersion = Ed.V2 Ed.DistanceUnits = Ed.CM Ed.Tempo = Ed.TEMPO_MEDIUM #--------Your code below----------- while True: Ed.PlayBeep() # Beep Ed.LeftLed(Ed.ON) # Turn the left LED ON Ed.RightLed(Ed.ON) # Turn the right LED ON Ed.TimeWait(1, Ed.TIME_SECONDS) # Wait for 1 seconds Ed.LeftLed(Ed.OFF) # Turn the left LED OFF Ed.RightLed(Ed.OFF) # Turn the right LED OFF

Edison Drive System The drive system used by Edison is : Differential drive This drive allows Edison to move in any direction In EdPy there is a function called Ed.drive which lets you control both motors

What are Functions Direction ( Forward – Backward – Stop) Functions are pieces of code that perform a certain task depending on one of the following input Direction ( Forward – Backward – Stop) Speed ( 1-10) Distance (Ed.CM – Ed.INCH – Ed.TIME)

Activity 5– Page 52 #-------------Setup---------------- import Ed Ed.EdisonVersion = Ed.V2 Ed.DistanceUnits = Ed.CM Ed.Tempo = Ed.TEMPO_MEDIUM #--------Your code below----------- # Drive the left motor forward at half of the speed for unlimited distance Ed.DriveLeftMotor(Ed.FORWARD, Ed.SPEED_5, Ed.DISTANCE_UNLIMITED)   # Drive the right motor forward at half of the speed for unlimited distance Ed.DriveRightMotor(Ed.FORWARD, Ed.SPEED_5, Ed.DISTANCE_UNLIMITED) # Wait for 3 seconds Ed.TimeWait(3, Ed.TIME_SECONDS) Program Edison to move 3 seconds at speed =5. turn both motors at the same time

Activity 6– Page 53 #-------------Setup---------------- import Ed Ed.EdisonVersion = Ed.V2 Ed.DistanceUnits = Ed.CM Ed.Tempo = Ed.TEMPO_MEDIUM #--------Your code below----------- Ed.DriveLeftMotor(Ed.BACKWARD, Ed.SPEED_8, Ed.DISTANCE_UNLIMITED) Ed.DriveRightMotor(Ed.BACKWARD, Ed.SPEED_8, Ed.DISTANCE_UNLIMITED) Ed.TimeWait(4, Ed.TIME_SECONDS) Program Edison to move 3 seconds at speed =5. turn both motors at the same time

Be Fast and Program First to be a winner Program Edison to beep and turn both LEDs ON for 1 seconds and then to move 3 seconds at speed =4. turn both motors at the same time

Turning Edison using Angle First, make the speed of the motors different from each other, based on which direction you want Edison to turn. Then, control the timing of the rotation until you get the angle you need. It is important to note that the timing values depend on: the speed of the motors. the surface on which the robot is driving. the battery life.

Activity 7– Page 55 #-------------Setup---------------- import Ed Ed.EdisonVersion = Ed.V2 Ed.DistanceUnits = Ed.CM Ed.Tempo = Ed.TEMPO_MEDIUM #--------Your code below----------- Ed.DriveLeftMotor(Ed.FORWARD, Ed.SPEED_6, Ed.DISTANCE_UNLIMITED) Ed.DriveRightMotor(Ed.STOP, Ed.SPEED_8, Ed.DISTANCE_UNLIMITED) Ed.TimeWait(800, Ed.TIME_MILLISECONDS)

Activity 8– Page 56

Activity 9– Page 56 #-------------Setup---------------- import Ed Ed.EdisonVersion = Ed.V2 Ed.DistanceUnits = Ed.CM Ed.Tempo = Ed.TEMPO_MEDIUM #--------Your code below----------- # Drive both motors forward at a speed of 9 for 30 centimetres Ed.Drive (Ed.FORWARD, Ed.SPEED_9, 30)

End-of-unit Assessment