Loops with Multiple Sensor Controls

Slides:



Advertisements
Similar presentations
RCX Workshop Day 2 Programming with Touch Sensor Light Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological University.
Advertisements

NXTG Workshop Day 2 Programming with Touch Sensor Light Sensor Ultrasonic Sensor Repeat CJ Chung Associate Professor of Computer Science Lawrence Technological.
EducateNXT Follow the Leader Using Bluetooth communication, one robot can be made to follow the actions of a second robot. Features in this presentation:
While Loops and If-Else Structures
Bluetooth Remote Control
More switches Day 6 Computer Programming through Robotics CPST 410 Summer 2009.
Reviewing Common Blocks for St. Agnes Elementary School Teachers by Jenny Chang Feb. 26th, 2007 USC & University Neighborhood Outreach Robotics STEM program.
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.
Testbed: Exercises.
Introduction to LEGO NXT 6 hour course. Introductions You Your Expectations.
Program ultrasonic range sensor in autonomous mode
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.
Robotics NXT sensors Back to Light sensor: red vs blue ball.
Unit 5 – “Watch Out!”. Introduction New Topics Case Structures New Functions Less? Comparison Function Ultrasonic Sensor.
LabVIEW Program and Data Flow Review LabVIEW Robotics Fundamentals.
LabVIEW Basics Review LabVIEW Robotics Fundamentals.
More switches, Comparison Day 7 Computer Programming through Robotics CPST 410 Summer 2009.
Using Waits, Loops and Switches WAIT please!. Waits, Loops and Switches Pre-Quiz 1. In programming, what is a loop? When is a loop useful? 2. How can.
Application of Data Programming Blocks. Objectives  Understand the use of data programming blocks and their applications  Understand the basic logic.
Obstacle Detection Introductory Presentation. Opening Activity If you were blindfolded, what senses would you use to find things in the room?
The LOGIC and MATH blocks Day 9 Computer Programming through Robotics CPST 410 Summer 2009.
Real-Time Data through Data Hubs. Begin by adding a basic Move block, 5 rotations 75% power.
Sentry System Multiple Sensors
Lego MindStorm An Introduction to Blocks. Blocks Blocks are used to give instructions to your robot. There are many types of blocks You can use the blocks.
Forward Until Sound Program
While and If-Else Loops ROBOTC Software. While Loops While loop is a structure within ROBOTC Allows a section of code to be repeated as long as a certain.
Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.
Data Hubs and Wires. Begin by adding a basic Move block, 5 rotations 75% power.
Mindstorm NXT-G Introduction Towson University Robotics.
Obstacle Detection. In the previous program the robot moves forward and then checks for something in the way. As we observed it only checks for things.
Forward Until Near Stop when near a wall.
Robotics Programming Wall Follow Line tracking for a set amount of time Line tracking for a distance.
© 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.
By Sanjay and Arvind Seshan
ROBOTC for VEX Online Professional Development
ROBOTC for VEX On-Site Professional Development
Using tools and the ‘Wait’ Block
Introduction To Programming with LEGO NXT 0
ROBOTC for VEX Online Professional Development
Touch Sensor.
Bluetooth example Presentations Lab: building projects
Loops and Switches Pre-Quiz
INTERMEDIATE PROGRAMMING LESSON
Introductory Presentation
Module F: Presentation Understanding Robot Fundamentals
BEGINNER PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
Displaying sensor values while a robot is running
Introductory Presentation
Obstacle Detection Ultrasonic Sensor.
Introductory Presentation
Sensors and Logic Switches
Forward Until Touch Robot goes forward until it hits a wall.
Line Following Behavior
Switch Blocks check a value and choose a path based on that value
Storing Values as Variables
SENSORS.
BEGINNER PROGRAMMING LESSON
BEGINNER EV3 PROGRAMMING Lesson
if-else Structures Principles of Engineering
Introductory Presentation
Using Waits, Loops and Switches
Loops and Switches How Do You Make Loops and Switches? lesson > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Obstacle Detection.
Obstacle Detection.
Lego MINDSTORMS EV3.
INTERMEDIATE PROGRAMMING LESSON
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

Loops with Multiple Sensor Controls

Open the basic Line Following Program

Modify the program so that the loop ends when the Touch Sensor is pressed or the Ultrasonic Sensor detects an object closer than 25 centimeters away.

Set the loop to be controlled by Logic.

First Create a loop that is controlled by the Touch Sensor First Create a loop that is controlled by the Touch Sensor. Drag a yellow Touch Sensor Block into the loop. Wire the Touch Sensor Block’s Yes/No plug to the Loops end block logic plug

The Touch Sensor Block is set to watch for the pressed action The Touch Sensor Block is set to watch for the pressed action. This will send a true check any time the touch sensor is pressed to end the loop. Download and test the program, it should stop following the line when the touch sensor is pressed.

Adding a Second Sensor Place an Ultrasonic Block after the Touch Sensor Block.

Set the threshold for the Ultrasonic Sensor Block to less than 20 cm. True on the yes/no plug means the ultrasonic Sensor Block is seeing a value less than 20 centimeters. There is only one plug on the Logic Loop but two sensors to plug in therefore a Logic Block is required.

Break the wire into the Logic Loop and rewire it into the A input plug on the Logic Block.

Wire the Yes/No on the Ultrasonic Block to the B plug on the Logic Block.

Select the Logic Block and set the operator to Or. If either the Touch Sensor or the Ultrasonic Senor are sending out a true value to A or B the Logic Block will output true. Wire the Logic Block to the Logic Loop plug. The True/False value now controls the loop.

If the touch sensor is pressed the Touch Sensor Block will feed a True into the Logic Block. If the Ultrasonic sensor detects something 20 cm away it will feed a True into the Logic Block. The Logic Block will pass on a True if either one of the two sensors is sending it a true. Finally the Logic Loop Endblock is waiting to see a true to end the loop.

Download and test the program, it should stop following the line when the Touch sensor is pressed or the Ultrasonic sensor is less than 20 cm away from an object. Place the can midway along the line so that the robots Touch sensor detects the can. Did the robot stop the line following loop? NEXT Place the PVC pipe along the line so that the robot detects the pipe as it follows the line. Did the robot stop the line following loop?