Using Waits, Loops and Switches

Slides:



Advertisements
Similar presentations
EducateNXT The Corridor Challenge The Corridor Challenge requires programming of a robot to negotiate obstacles and the corridor walls in order to reach.
Advertisements

How Do You Make a Program Wait?. 1. What is an algorithm? 2. Can you think of a reason why it might be inconvenient to program your robot to always go.
Follow the Light Follow the Light Presentation > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Robot Soccer Challenge
More switches Day 6 Computer Programming through Robotics CPST 410 Summer 2009.
Remote Control Using Bluetooth. 1. Give two examples of electrical connections. 2. What is the difference between wired and wireless connections? 3. What.
Introduction to NXT Software and Functionality Bot’oberfest October 15, 2007.
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.
Control Using Sound. 1. What is sound? 2. How does the LEGO sound sensor sense sound? 2 Control Using Sound Pre-Quiz.
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.
Music by Touch. 1. Provide an example “stimulus-sensor- coordinator-effector-response” framework for both your (human) sense of touch and the robotic.
What Is a Program?. What Is a Program? Pre-Quiz 1. What is a program? 2. What is an algorithm? Give an example. 2.
Programming 101 The Common Palette Content provided by Connor Statham (6 th Grade Student) Formatting by Shannon Sieber.
Navigating a Maze. Navigating a Maze Pre-Quiz 2 1. What is the difference between a program and an algorithm? 2. About how many inches does an NXT move.
Getting Started! Lego Mindstorms Program NXT 2.0.
Maze Challenge Maze Challenge activity > TeachEngineering.org
Wait Program! WAIT please!. 1. Why is it often better to use conditional commands rather than program a robot to move exact distances? 2. What is the.
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 Overview of NXT-G Actuators in Mindstorms. Touch sensor Labwork: Right turn. Touch/bump. [Explore move versus Motor Move mini & motor mini. Motor*.]
GIRLS Robotics Objective of today Review last Saturday’s Lesson Create our 1 st robot.
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.
Find the Mindstorms Icon on the computer.. To start a new program click go.
Entering your user ID into the NXT Clicker *Your User ID is your Netpass username.
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.
How Do You Make a Program Wait?
The Corridor Challenge
Remote Control Using Bluetooth
LEGO MINDSTORMS PROGRAMMING
Line-Follower Challenge
BEGINNER PROGRAMMING LESSON
Don’t Bump into Me! Presentation > TeachEngineering.org
Mindstorms EV3 Programming
By Sanjay and Arvind Seshan
Follow the Light Follow the Light Presentation > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Mindstorms EV3 Programming
What Is a Program? What Is a Program? lesson > TeachEngineering.org
How Does a Color Sensor Work?
Introduction To Programming with LEGO NXT 2
Robot Soccer Challenge
Bluetooth example Presentations Lab: building projects
Programming Part 2 Mod Kit
How Does an Ultrasonic Sensor Work?
Navigating a Maze.
How Does a Touch Sensor Work?
Mindstorms EV3 Programming
Loops and Switches Pre-Quiz
Music by Touch Music by Touch Presentation > TeachEngineering.org
Programming.
Module F: Presentation Understanding Robot Fundamentals
INTERMEDIATE PROGRAMMING LESSON
Forward Until Touch Robot goes forward until it hits a wall.
Controlling your quadcopter
Sumobot Challenge Sumobot Challenge Activity > TeachEngineering.org
An Introduction to VEX IQ Programming with Modkit
INTERMEDIATE PROGRAMMING LESSON
Line Following Behavior
Navigating a Maze.
SENSORS.
Lego EV3 Mindstorms SW Programming Blocks.
Maze Challenge Maze Challenge activity > TeachEngineering.org
INTERMEDIATE PROGRAMMING LESSON
Computer Basics.
Loops and Switches How Do You Make Loops and Switches? lesson > TeachEngineering.org Center for Computational Neurobiology, University of Missouri.
Graphical User Interfaces
Controlling your quadcopter
LEGO MINDSTORMS NXT PROGRAMMING
Presentation transcript:

Using Waits, Loops and Switches please!

Waits, Loops and Switches Pre-Quiz 1. In programming, what is a loop? When is a loop useful? 2. How can you control the duration for which a loop repeats? 3. In programming, what is a switch? Center for Computational Neurobiology, University of Missouri

Waits, Loops and Switches Pre-Quiz Answers 1. In programming, what is a loop? When is a loop useful? A loop is an operator that allows us to repeat a set of commands indefinitely. Loops are useful when you need to repeat a set of commands multiple times. 2. How can you control the duration for which a loop repeats? You can control how many times a loop repeats by clicking the dropdown arrow next to “Control” on the loop block and setting it to forever, time, sensor, count or logic. 3. In programming, what is a switch? In programming, a switch is an object that gives different commands depending on the state it is in. Center for Computational Neurobiology, University of Missouri

Wait Block Activity Objective: Combine wait blocks, loops and switches to perform a task Do This: First, attach 2 touch sensors (name them A and B) Then program the robot to perform the following task: Stay at rest and display “Ready” on the screen. Move left and display “Forward” whenever touch sensor 4 is pressed. Move right and display “Reverse” whenever touch sensor 1 is pressed Stay at rest and display “Stop” when no buttons are pressed. ***Hint: Click on the icon, drag the block into the program, and select “Text” from the dropdown menu to display text on screen.

Wait Block Activity Solution 10 11 4 6 7 1 2 3 5 8 9 12

Wait Block Activity Solution 1 2 3 4 various settings

various settings (continued) Wait Block Activity Solution 5 6 7 various settings (continued)

various settings (continued) Wait Block Activity Solution various settings (continued) 8 9

various settings (continued) Wait Block Activity Solution various settings (continued) 10 11

various settings (continued) Wait Block Activity Solution various settings (continued) 12

Waits, Loops and Switches Post-Quiz 1. In programming, what is a loop? When is a loop useful? 2. How can you control the duration for which a loop repeats? 3. In programming, what is a switch? Center for Computational Neurobiology, University of Missouri

Waits, Loops and Switches Post-Quiz Answers 1. In programming, what is a loop? When is a loop useful? A loop is an operator that allows us to repeat a set of commands indefinitely. Loops are useful when you need to repeat a set of commands multiple times. 2. How can you control the duration for which a loop repeats? You can control how many times a loop repeats by clicking the dropdown arrow next to “Control” on the loop block and setting it to forever, time, sensor, count or logic. 3. In programming, what is a switch? In programming, a switch is an object that gives different commands depending on the state it is in. Center for Computational Neurobiology, University of Missouri

Vocabulary brainstorming: Thinking of ideas as a group. iteration: Doing something again, especially with the intent to make improvements. loop: An operator that repeats a set of commands. switch: In programming, a switch is an object that gives different commands, depending on the state it is in. Center for Computational Neurobiology, University of Missouri

Images Sources Slides 1: wall switch drawing; source: Microsoft® clipart: http://office.microsoft.com/en- us/images/results.aspx?qu=light+switch&ex=1#ai:MC900441745| Device and programming images from LEGO MINDSTORM NXT User’s Guide http://goo.gl/wuhSUA Screen captures, diagrams and drawings by author Center for Computational Neurobiology, University of Missouri