Question
***VERY URGENT, THIS IS AN ARDUINO QUESTION. PLEASE ANSWER FAST, I WILL UPVOTE YOUR ANSWER**** //variables int YELLOW = 3; int RED = 4; int
***VERY URGENT, THIS IS AN ARDUINO QUESTION. PLEASE ANSWER FAST, I WILL UPVOTE YOUR ANSWER****
//variables
int YELLOW = 3;
int RED = 4;
int DELAY_YELLOW = 1000;
int DELAY_RED = 1000;
// basic functions
void setup()
{
pinMode(YELLOW, OUTPUT);
pinMode(RED, OUTPUT);
}
void loop()
{
yellow_light();
delay(DELAY_YELLOW);
red_light();
delay(DELAY_RED);
}
void yellow_light()
{
digitalWrite(YELLOW, HIGH);
digitalWrite(RED, LOW);
}
void red_light()
{
digitalWrite(YELLOW, LOW);
digitalWrite(RED, HIGH);
}
Modify the program so that while the button is held down the LEDs alternate as fast as possible. When the button is not pressed the LED state freezes. This creates a random color program
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