Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Arduino homework for sample I need a sample to understand the homework. You don't have to do everything. The help I need is the led

Arduino homework for sample

I need a sample to understand the homework. You don't have to do everything. The help I need is the led blinking part.

I already choose some setup words to make the code simple. Here are pictures of the structure.

image text in transcribed

image text in transcribed

const byte ledRN = 11;

const byte ledYN = 12;

const byte ledGN = 13;

const byte ledRW = 5;

const byte ledYW = 6;

const byte ledGW = 7;

const byte butt1 = 2;

const byte butt2 = 3;

void setup()

{

pinMode(ledRN, OUTPUT);

pinMode(ledYN, OUTPUT);

pinMode(ledGN, OUTPUT);

pinMode(ledRW, OUTPUT);

pinMode(ledYW, OUTPUT);

pinMode(ledGW,OUTPUT);

pinMode(butt1, INPUT);

pinMode(butt2, INPUT);

Serial.begin(9600);

}

My note(I'm not sure it's helpful for you):

image text in transcribed

The Circuit The hardware can be attached to your breadboard; designate one side of your board to be for the highway traffic light and the other for the cross streets. The photoresistor and button can go wherever you have room on the breadboard. Must use the Arduino kit. Use: O O 6 total leds (2 red, 2 yellow, 2 green); for the 2 traffic lights. 1 photoresistor; for a car sensor on the cross street. 1 button; to simulate 'loss of power' mode. Other necessary resistors, jumper wires... O O The Code The following requirements for the code are team requirements, meaning that the team's final code needs to fulfill these requirements. O Use: o Only variables used as function inputs; example, use delay(time1), not delay(1000) o Multiple 'if' statements (else if's and else's count as if's); to control traffic lights and sensors Each person needs to have if (else if, else) statements As a team At least 1 'for' loop At least 1 'while' loop Use comments to Name the version of code, the authors, and the date at the top of the code Describe what a section of code does Denote which team member did which section 0 Include and use serial prints to help see what the analog values are and to help find errors. O DIGITAL (PWM) O UNO XARDUINO w N=North R,Y G = colors if button state =0 NR NY NG NR WG t @ NR WR WY NG VG WR b @WR f NR

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

Databases On The Web Designing And Programming For Network Access

Authors: Patricia Ju

1st Edition

1558515100, 978-1558515109

More Books

Students also viewed these Databases questions