Answered step by step
Verified Expert Solution
Question
1 Approved Answer
It is desired to control 4 LEDs with a varying input voltage using a potentiometer. Its operation will be as follows: -if the voltage read
It is desired to control 4 LEDs with a varying input voltage using a potentiometer. Its operation will be as follows: -if the voltage read is between 0-1.25 volts, all leds are off. -If the voltage read is between 1.25-2.5 volts, only green (1st led from the left) will light. -If the voltage read is between 2.5-3.75 volts, only the yellow led (2nd led from the left) will light. -If the voltage read is between 3.75-5 volts, only the red led (3rd led from the left) will light. Accordingly, write the rest of the Arduino code given below (you can choose the pin numbers yourself). Complete the connections on the circuit diagram. Vin D13 D12 3V3 5v Power RST AREF 10 REF Arduino N/C D11 PWM PWM D10 D9 DB D7 D6 PWM Digital Input/Output PWM DS AO D4 A1 D3 D2 A3 TX Analog Input D1 A4 DO AS SCL SDA GND int greenLed=8; int yellowLed=9; int redLed=10; void setup() {
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started