Stop Light Lab 7 Winter Quarter.

Slides:



Advertisements
Similar presentations
PIC Programming with Logicator
Advertisements

MICROCONTROLLERS MODULE 2 Programming, Controlling and Monitoring.
1 Boe-Bot Parts BOE-BOT Lecture #1b DE - Digital Electronics.
EIGHTH GRADE ROBOTICS KITTATINNY REGIONAL HIGH SCHOOL MR. SHEA Introduction to Programming
Software Design Project
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 26P. 1Winter Quarter Handy Board Lecture.
Digital Outputs 7-Segment Display
1 Introduction to Coding. 2 Example Codes A lot of example codes are given with Arduino IDE A code can often be based on a previous example rather than.
Introduction to Arduino Prepared by R. Lamond.  “Arduino is an open-source electronics prototyping platform based on flexible, easy- to-use hardware.
Embedded Programming and Robotics
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lab 7P. 1Winter Quarter Stop Light Lab 7.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit EGN1007.
Testbed: Exercises.
Creative Inventions and Robotics Programming with Robolab By Rebekah Gendron.
Introduction to Interfacing Projects Nareen Khan.
Looping forever Reading/observing sensors (inputs) Reacting to sensors Obstacle sensors.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class 2.
Lego Robot Construction Project. Adam, Roger, Lu, Riana, Paul.
Software Programmed in C 1. lightCycle: Function that cycles the lights when the CapSense is activated, cycles lights from Red to Green. 2. If, else: Determines.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering –Intro to the Robotics –Introducing the IC –Discuss.
The George Washington University Department of ECE ECE 1010 Intro: Electrical & Computer Engineering –Introducing KIPR Link/Interface and Set-up –Continuation.
Overview of Project 5 Slides are available at : Project will be checked off in class
Digital Electronics Board-of-Education : Input. Board of Education - Input This presentation will explain, both from a hardware and software perspective,
Semiconductors, ICs and Digital Fundamentals. The Diode The semiconductor phenomena. Diode performance with ac and dc currents. Diode types: –General.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 26P. 1Winter Quarter Handy Board Lecture 26.
Engineering H193 - Team Project Gateway Engineering Education Coalition Lab 1P. 1Spring Quarter Introduction to Sensors Lab 1.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 29P. 1Winter Quarter Software Design Project Lecture 29.
The George Washington University Electrical & Computer Engineering Department ECE 002 Dr. S. Ahmadi Class3/Lab 2.
A stop sign is a traffic sign that stands for coming to a complete stop at an intersection or end of the road.
Lesson 1: Motors and Sound Programming Solutions.
1.Mouths are quiet. 2.Begin the quick review section of your notes. 3.Raise your hand if you need something.
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.
Programming Basics - RobotC Introduction to Robotics.
1 Transistor. 2 Transistors are used to turn components on and off They come in all different shapes and sizes.
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Dr. S. Ahmadi Class 4.
Introduction to Programming in RobotC
ELECTRICAL CIRCUITS Multimeter.
Dr. Cynthia Furse University of Utah
User-Written Functions
ARDUINO BASED AUTOMATIC TEMPERATURE BASED FAN SPEED CONTROLLER
The George Washington University Department of ECE ECE Intro: Electrical & Computer Engineering Intro to the Robotics Introducing the IC Discuss.
Dr. Cynthia Furse University of Utah
ARDUINO FOUR QUADRANT DC MOTOR CONTROL
UCD ElecSoc Robotics Club 2017/2018
ARDUINO LINE FOLLOWER ROBOT
EECE 5117C/6017C Lab 2 Traffic Light Controller using FSM
Programming Scratch to Control a K’NEX Fairground Ride
Introducing KIPR Link/Interface and Set-up
ELEC 1041 Digital Electronics Tutorial: Word Problems
Introduction to Arduino Microcontrollers
Lighting LEDs with a RASPBERRY PI
Basics for Robotics Programming
Roller Coaster Design Project
Programming - Motion Intro to Robotics.
Working with Arduino: Lesson #1: Getting Acquainted with the Kit
Batteries: the Chemistry
Welcome to Digital Electronics using the Arduino Board
DC motor.
Programming Basics - RobotC
Electronics Objectives
Dave Mawdsley, DACS Member, Linux SIG January 16, 2013
An Introduction to VEX IQ Programming with Modkit
Recap the basics Lesson 1.
East West Move to Table 2 N/S
LEGO Education - Mindstorms EV3 - Computer/control center – The Brick
Arduino Uno circuit basics
Task 1 You are going to use the Makey Makey arrow inputs to create a joystick / games controller. Step 1: Connect Makey.
Topic 4: Connecting and Starting Single Phase Motors
2019 Investing Now Summer Program
Presentation transcript:

Stop Light Lab 7 Winter Quarter

What We Will Learn Real-time programming techniques Re-introduction to Interactive C and the Handy Board Simple motor port functions for traffic light control Instructor: In this lab, we will introduce some real-time programming techniques, along with some re-introduction to Interactive C and the Handyboard. We will use simple motor port functions to achieve open loop control of traffic lights at an intersection. Winter Quarter

Problem Statement Make the Handy Board control the stoplight at a intersection of two roads, one running North and South (NS), the other East and West (EW). The stoplight should be operated by Motor Ports 1-3 and should follow normal operation…meaning exactly one light (either EW or NS) should be red at any time. Follow this standard pattern: Red – 6 seconds Green – 4 seconds Yellow – 2 seconds Winter Quarter

Things to Know Positive polarity from the motor port will control NS light Negative polarity from the motor port will control EW light 1st and 3rd pin of motor port are the connection points, the middle one should have no connection Winter Quarter

The Handy Board Instructor: This is a photo of the HandyBoard controller. The motor ports are in the bottom left corner, and are labelled 0 through 3. The LED’s next to them light up depending on whether the port is on and the direction the motor is supposed to go. Winter Quarter

+ - Stoplight Circuit Forward Biased Reverse Biased motor (0, 100); Instructor: The stop light circuit consists of two LED’s in parallel with each other but opposite directions and a current limiting resistor in series with the two LED’s. When the HandyBoard executes the command shown, the one LED will be forward biased and turn on, while the other LED will be reverse biased and turn off. Winter Quarter

- + Stoplight Circuit motor (0, -100); Reverse Biased Forward Biased Instructor: When the same command is executed but in the negative direction, the current will flow in the other direction, reversing which LED is on and which is off. Winter Quarter

Some Tips on How To Modify Your Code Modify functions to use Handy Board "motor" function in addition to or in place of "printf" Remember that if you use "printf", the display screen is only 32 characters long Remove any #include statements Move function bodies from below main ( ) to above main ( ) Instructor: You should have code already written that can perform this type of control. You should modify your functions to use the HandyBoard motor functions in addition to or in place of the printf commands. If you choose to leave the printf commands in, remember that the display screen is only 32 characters long. Since the Interactive C does not use #include statements, remember to remove them from the code. Interactive C also does not use function prototypes, so move the function bodies from below the main function to above the main function. Winter Quarter

Some More Tips on How To Modify Your Code Replace any "do…while" loops with "while" loops Replace use of UNIX "time" function with use of Handy Board "seconds" function for computing elapsed time Remember that Handy Board "sleep" function requires a floating point parameter Instructor: Replace any do.. While loops with while loops since Interactive C does not recognize the do.. While command. Also, replace the UNIX time function with the HandyBoard seconds function for computer elapsed time. Remember that the HandyBoard sleep function requires a floating point parameter unlike the UNIX version. Winter Quarter

Examples of Useful IC Functions Pause for two seconds sleep (2.0) ; Turn motor port 1 on full power motor (1, 100) ; Turn motor port 1 off motor (1, 0) ; Wait for the "start" button while (!start_button ( ) ) ; Instructor: Here are some useful Interactive C commands. Winter Quarter