Using Switches to Program A candy Sorter

Slides:



Advertisements
Similar presentations
Getting started with LEGO NXT Mindstorms software This is intended to be a short introduction to the LEGO Mindstorms software and programming the LEGO.
Advertisements

Sensors.
Sensors For Robotics Robotics Academy All Rights Reserved.
Photos and Sensor Instructions
Sensors For Robotics Robotics Academy All Rights Reserved.
SE 313 – Computer Graphics Lecture 13: Lighting and Materials Practice Lecturer: Gazihan Alankuş 1.
BEGINNER EV3 PROGRAMMING Lesson
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
1 ©2006 INSciTE Lab Two Task: Make the program from Lab One (Move forward 5 rotations and turn right 90 degrees) into a MyBlock.
Session 2  The Touch Sensor  The Colour Sensor.
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.
EV3 Workshop Oct 3, 2015 Instructor: Chris Cartwright
Motors and Sound Troubleshooting Tips. © H-CCS Problem 1 Why can’t I download my program to the RCX?
Negative Power or Negative Rotation makes robot go backwards. But if both are negative, the robot will go forward! Move Steering Block.
Sentry System Multiple Sensors
BEGINNER EV3 PROGRAMMING LESSON By: Droids Robotics Using Sensor Data and Port View.
What’s in the Box?
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.
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.
Lego Mindstorm Robots 9797 kit.  Students will learn how to identify how to detect a change in a condition.  Students will learn where and how to identify.
USING SWITCHES TO PROGRAM A CANDY SORTER DESIGNED FOR USE WITH LMS EV3 PROGRAMMING AND BUILDING ENVIRONMENT.
Python Programming Module 4 Sensors and Loops Python Programming, 2/e1.
ROBOTC for CORTEX Teacher Training © 2011 Project Lead The Way, Inc. Automation and Robotics VEX.
BEGINNER PROGRAMMING LESSON
How Do You Make a Program Wait?
LEGO Robotics Workshop
By Sanjay and Arvind Seshan
BEGINNER PROGRAMMING LESSON
LEGO MINDSTORMS PROGRAMMING
Exploring Computer Science Lesson 6-5
Line-Follower Challenge
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
Deriving Consistency from LEGOs
Resistors How can we intentionally change the amount of resistance in our circuit?
Sensors For Robotics Robotics Academy All Rights Reserved.
By Sanjay and Arvind Seshan
By Sanjay and Arvind Seshan
Touch Sensor.
Sensors For Robotics Robotics Academy All Rights Reserved.
What’s in the Box?
Using Switches to Program A candy Sorter
BEGINNER PROGRAMMING LESSON
Automation and Robotics
Beginner Programming Lesson
BEGINNER EV3 PROGRAMMING Lesson
BEGINNER EV3 PROGRAMMING Lesson
Exploring Computer Science Lesson 6-5
BEGINNER PROGRAMMING LESSON
BEGINNER PROGRAMMING LESSON
Beginner Programming Lesson
Holyoke Codes LEGO ROBOTICS
Lesson 3: Finding Lines On The Mat
Switch Blocks check a value and choose a path based on that value
BEGINNER PROGRAMMING LESSON
Beginner Programming Lesson
EV3 Programming guide to “Following”
BEGINNER PROGRAMMING LESSON
Lesson 3: Sensor Wait-for’s Programming Solutions
SENSORS.
BEGINNER PROGRAMMING LESSON
The programming page of the Brick
What Color is it?.
Compiled from various Internet sources Presented by Mr. Hatfield
Obstacle Detection.
Lego MINDSTORMS EV3.
BEGINNER PROGRAMMING LESSON
Getting started with LEGO EV3 Mindstorms software
Presentation transcript:

Using Switches to Program A candy Sorter Designed for use with LMS EV3 programming and building environment

Evaluating Candy Sorters Watch Discuss How does this sort the candy? What is one part you really like about it? What is one weak point in the build? What is one thing you would change to improve the machine?

Evaluating Candy Sorters Watch Discuss How does this sort the candy? What is one part you really like about it? What is one weak point in the build? What is one thing you would change to improve the machine?

Evaluating Candy Sorters Watch Discuss How does this sort the candy? What is one part you really like about it? What is one weak point in the build? What is one thing you would change to improve the machine?

Evaluating Candy Sorters Watch Discuss How does this sort the candy? What is one part you really like about it? What is one weak point in the build? What is one thing you would change to improve the machine?

Watch Watch Different STyle These two groups used the reflective property of the gumballs to sort them into “cool” and “warm” colors. What are the advantages and disadvantages of doing it this way? Watch Watch

It can detect the overall amount of light in a room EV3 Color Sensor 3 Modes Ambient Reflective Color It can detect the overall amount of light in a room One bulb “shoots” a beam of light at a surface, the other bulb “reads” the percentage of light reflected back The color sensor can detect black, white, red, blue, green, yellow, and “no color”

In color mode it works best with LEGO

For Example these dark blue gumballs might be read as black Don’t try to force the software to read the “correct” color Instead, accurately record the color it says an object is and use that throughout your program

Hold it close to color (about half inch) Using the color sensor Hold it close to color (about half inch) On the brick, navigate to port view, choose the sensor, then make sure you choose the right mode

Hold it close to color (about half inch) Using the color sensor Hold it close to color (about half inch) Using the EV3 software or iPad App you click on the bottom right to get to port view

Using your color sensor what readings do you get for your gumball/candy? Actual Color Reflective Light Mode Color Mode

A switch is found in the orange flow palette

A Switch checks a condition, then chooses a path based on that condition Choose what type of switch you want This is a touch sensor switch It will “choose” what action to take based on the condition of the touch sensor in port 1

Two choices – Compare mode Touch sensor is set to “push in” That’s the “true” statement Think “true” = “top” It will do what’s on top (in this case show the smile image) if the statement is true If touch sensor is not pushed in (false) the bottom action is chosen (display sad image)

By placing switch in a loop, you can continuously change the displayed image When touch sensor is pushed in, it will show the smile image When touch sensor is out, it will show the sad image

How to a color sensor switch Choose the correct mode Choose color Sensor Then choose measure Then choose color

Color Sensor Switch You can choose a default (What the program should always do if nothing is happening) Click this circle to assign a case to be the default In this example if no color is sensed, the motors will stop If black is sensed the motors will turn on for 1 rotation at half power (50) But if another color is sensed, the motors will also stop, because that is the default position and we haven’t added other colors yet

Adding more colors/conditions If you wish to add more conditions, click the plus sign You can add as many as you like (but you only have a few different colors, so you are limited) In this example I have kept motors stop as my default action (and also the no color action) If blue is sensed, my motors turn forward for one rotation If green is sensed, my motors turn backwards for one rotation

Now it’s your turn – helpful hints Programming building Color sensor A switch with several colors won’t be enough. The switch will have to be a part of a larger more complex program Work on one part of the program at a time Test one color at a time rather than trying to write the program for all colors Solid building is important – if parts move weakly, or are not supported, or are not solid, it won’t work Use cross bracing to support your structure Connect motors so they spin axles rather than motors spinning around axles Must be close (1/4 inch is good) to object it will detect Must be static, a color sensor that moves or swivels will not work Constantly check and recheck your readings