Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions