More switches Day 6 Computer Programming through Robotics CPST 410 Summer 2009.

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.
Introduction to Macromedia Director 8.5 – Lingo
EducateNXT Follow the Leader Using Bluetooth communication, one robot can be made to follow the actions of a second robot. Features in this presentation:
TE Sessions Supported by: Basic Concepts of Programming November 3, 2012.
Tonight’s JavaScript Topics 1 Conditional Statements: if and switch The Array Object Looping Statements: for, while and do-while.
Programing Concept Ken Youssefi/Ping HsuIntroduction to Engineering – E10 1 ENGR 10 Introduction to Engineering (Part A)
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
An Intro to Robots and Computer Programming
Introduction to NXT Software and Functionality Bot’oberfest October 15, 2007.
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
Reviewing Common Blocks for St. Agnes Elementary School Teachers by Jenny Chang Feb. 26th, 2007 USC & University Neighborhood Outreach Robotics STEM program.
Variables, logic and sensors Day 3 Computer Programming through Robotics CPST 410 Summer 2009.
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.
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 Catchup/Review: switch, arithmetic, range, loop Bluetooth Lab: Finish parallel parking. Next: Use Bluetooth communication for calculate & send.
Introduction to the course Computer Programming through Robotics CPST 410 Summer 2009.
Encapsulation Day 11 Computer Programming through Robotics CPST 410 Summer 2009.
Computer Science Lego Robotics Lab 07 Page 51. CS Lego Robotics Lab 07 (Updated ) Objectives: 1.Extend the Lego robot with three sensors. 2.Program.
Introduction to LEGO NXT 6 hour course. Introductions You Your Expectations.
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.
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.
Programming a light sensor to follow a black line.
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.
Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
The LOGIC and MATH blocks Day 9 Computer Programming through Robotics CPST 410 Summer 2009.
NXT Basics: Technic Building and NXT-G Erin Cejka Riecker Center for Engineering Educational Outreach Tufts University.
Motors and Sound Troubleshooting Tips. © H-CCS Problem 1 Why can’t I download my program to the RCX?
Robots Week 3a Programming Lesson 2: Modifiers, Loops and Jumps Programming Solutions.
Wall Encounter By Made easy by Dwayne Abuel.
Introduction to Data & Advanced Programming Blocks ROBOTICS II Module 1 Done by: Eng Nooran Drak.
Robotics Challenges. Challenge Slide 2 Have your robot make a left curved turn around your Lego person. Go forward, then reverse. Come to a stop, play.
Conditions and loops Day 4 Computer Programming through Robotics CPST 410 Summer 2009.
THE TOUCH SENSOR The Touch Sensor, shown in the picture, gives the robot the sense of touch. It gives too different signals when the orange part is ether.
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.
Castor Bot. Now, we will begin creating a robot Log onto your computer On your screen, click on the website labeled “castor bot” Your building instructions.
Comparison the RANGE block Day 8 Computer Programming through Robotics CPST 410 Summer 2009.
Title Slide Progress Report Name. Goal Goal Statement – ex. design/create/fabricate … - should be clear and short Needs/Problems – clear and short Space.
Robot Programming. Programming Behaviors Behaviors describe the actions and decisions of your robot.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4/Lab3.
By Droids Robotics INTERMEDIATE PROGRAMMING LESSON BRICK BUTTONS AS SENSORS.
Programming 101 The Common Palette Content provided by Connor Statham (9 th Grade Student) Formatting by Shannon Sieber.
1 ©2006 INSciTE Common Blocks. 2 ©2006 INSciTE Common Blocks Common blocks are full featured actions Like English statements Move Wait for an action Display.
Mindstorm NXT-G Introduction Towson University Robotics.
Lesson 1: Motors and Sound Programming Solutions.
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.
MEH108 - Intro. To Engineering Applications KOU Electronics and Communications Engineering.
BEGINNER PROGRAMMING LESSON
Mindstorms EV3 Programming
Mindstorms EV3 Programming
Introduction To Programming with LEGO NXT 2
Mindstorms EV3 Programming
Loops and Switches Pre-Quiz
Module F: Presentation Understanding Robot Fundamentals
Sensors and Logic Switches
INTERMEDIATE PROGRAMMING LESSON
Loops with Multiple Sensor Controls
Forward Until Touch Robot goes forward until it hits a wall.
INTERMEDIATE PROGRAMMING LESSON
Line Following Behavior
Lego EV3 Mindstorms SW Programming Blocks.
INTERMEDIATE PROGRAMMING LESSON
Program Flow.
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.
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

More switches Day 6 Computer Programming through Robotics CPST 410 Summer 2009

7/1/09Harry Howard, CPST 410, Tulane University2 Course organization  Course home page Course home page  (  Lab (Newcomb 442) will be open for practice with 3-4 Macs, but you can bring your own laptop and all robots.

Stop it Kelly §13

7/1/09Harry Howard, CPST 410, Tulane University4 The STOP block  The STOP block, in the Complete palette under the Flow icon, stops a program from continuing.  It is a good way to break out of loops.  Tribot, beep until the Touch sensor is pressed.

7/1/09Harry Howard, CPST 410, Tulane University5 Stop.rbt

7/1/09Harry Howard, CPST 410, Tulane University6 The NXC analog  NXC has a constant ‘break’ that breaks a loop whenever it is encountered in a program.  How would you formulate the previous program for NXC?  First you need an endless loop.

7/1/09Harry Howard, CPST 410, Tulane University7 The endless loop task main() { while (true) { // statements here }

7/1/09Harry Howard, CPST 410, Tulane University8 Stop.nxc first version task main() { while (true) { PlayTone(440,500); Wait(500); if (Sensor(S1) ????) { break; }

7/1/09Harry Howard, CPST 410, Tulane University9 Stop.nxc final version task main() { SetSensorMode(S1, SENSOR_MODE_PERCENT); while (true) { PlayTone(440,500); Wait(500); if (Sensor(S1) < 98) // unpressed = 100! { break; }

7/1/09Harry Howard, CPST 410, Tulane University10 Protect your robot  Tribot, move forward until the Touch sensor is released.

7/1/09Harry Howard, CPST 410, Tulane University11 TouchStop.rbt

Pick a card, any card Kelly §12

7/1/09Harry Howard, CPST 410, Tulane University13 The RANDOM block  In the Complete palette under the Data icon.  It generates a number between 0 and 100, randomly.

7/1/09Harry Howard, CPST 410, Tulane University14 Display a random number  Tribot, display a random number between 20 and 80 every time the left NXT button is pressed and then beep, until the right button is pressed.

7/1/09Harry Howard, CPST 410, Tulane University15 DisplayRandom.rbt

7/1/09Harry Howard, CPST 410, Tulane University16 Random numbers in NXC  Random()  Returns a single number chosen randomly between 0 and 2 16 or 65,536.  Random(n)  Returns a single number chosen randomly between 0 and n-1.

7/1/09Harry Howard, CPST 410, Tulane University17 Display a random number in NXC

7/1/09Harry Howard, CPST 410, Tulane University18 More than two choices  SPOT, when I press the left NXT button, pick a number from 1 to 3. If the number is 1, display an image. If the number is 2, beep. If the number is 3, play a sound.  Drag out a SWITCH block and turn off Flat view  Control > Value  Type > Number  Conditions  1. > 1  2. > 2  + 3. > 3

7/1/09Harry Howard, CPST 410, Tulane University19 Switch3.rbt

7/1/09Harry Howard, CPST 410, Tulane University20 Next time  P2  Multiple switches in NXC.  Comparison: Kelly §15.  The RANGE and LOGIC blocks: Kelly §16-17.