Question: Suppose that you are given a distance notification system consisting of a set of three LEDs: one green, one yellow, and one red. These three

 Suppose that you are given a distance notification system consisting of

Suppose that you are given a distance notification system consisting of a set of three LEDs: one green, one yellow, and one red. These three lights are normal LEDs that can be powered from the Arduino. A second part of the system consists of a distance sensor that outputs a linear voltage inside its range (assume it can be simply connected to an analog pin to read its output). It sends OV when an object is detected at its maximum range of 20m (or further), unto a +5V signal at its minimum range of 0.5m (or shorter). Write a complete sketch that does the following: 20m to 10m: Green light on 50% duty cycle. . 10m to 5m: Green light on and yellow light on 50% duty cycle. 5m to 1m: Green light on, yellow light on, and red light on 50% duty cycle. Less than 1m: Green light on, yellow light on, and red light blinking. HINTS: Make liberal use of the map (value, fromLow, fromHigh, tolow, to High); command discussed in the lab. It will make this task much easier

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!