Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program for Arduino that controls a set of two traffic lights at a crossroads. Assume that when the east-to-west traffic lights are green

image text in transcribed

Write a program for Arduino that controls a set of two traffic lights at a crossroads. Assume that when the east-to-west traffic lights are green or amber, the north-to-south traffic lights are red. Green lights must stay on for 1 minute and the amber lights for 8 seconds (remembering that in all other cases the light must be set to red). You can assume that the Arduino is wired to the traffic lights in the following pin configuration. East-west traffic light .Green light-> Pin 0; Amber light->Pin 1; Red light -> Pin 2 North-south traffic light .Green light-> Pin 3; Amber light->Pin 4; Red light > Pin 5 [10 Marks] (I8) Write a program for Arduino that reads the analog input from a proximity sensor and outputs this value to a light emitting diode (LED). You can assume that the closer an object is to the proximity sensor, the higher its ADC value will be and the brighter the LED should shine. The analog input from the proximity sensor will require calibration in order to define the minimum and maximum of expected values to be read by the proximity sensor. This should be carried out during the first 5 seconds of the program (hint; millis) The circuit: .Proximity sensor attached to analog input 0 of the Arduino, LED attached from digital pin 9 of the Arduino to ground [10 marks]

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Practical Issues In Database Management A Refernce For The Thinking Practitioner

Authors: Fabian Pascal

1st Edition

0201485559, 978-0201485554

More Books

Students also viewed these Databases questions