Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Explain how this code works in Arduino and construct a circuit for it //variables int YELLOW = 3; int RED = 4; int DELAY_YELLOW =

Explain how this code works in Arduino and construct a circuit for it

//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);

}

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

More Books

Students also viewed these Databases questions

Question

Overcome many cross-cultural communication barriers.

Answered: 1 week ago