Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

plz i need the block code i have all the answer expt the block code PART 3 150 points) Write an Arduino code to simulate

plz i need the block code i have all the answer expt the block code image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
image text in transcribed
PART 3 150 points) Write an Arduino code to simulate the traffic light that you recorded in Part 1. Paste both Block code and Text code in the boxes below. Block Code: Text Code: ..-101 ANALOG IN ..... ...10 DIGIT OO UNO POWER -.. .... ARDUINO DI .... ..- ..11 ... S. ..... .. ..... .... - .. Find real traffic light in your area and record with a stopwatch how much time takes for each light to turn on. East Red light Yellow light Green light Seconds 120 10 50 West Red light Yellow light Green light Seconds 117 9 55 South Red light Yellow light Green light Seconds 130 7 60 North Red light Yellow light Green light Seconds 125 8 57 fine ER 2 define EY 3 define EG 4 #define WR 5 define WY 6 #define WG 7 define SR 8 define SY 9 define SG 10 define NR 11 define NY 12 define NG 13 void cast(); void west() void south(); void north(); 11 the setup routine runs once when you press reset: void setup() { pinMode(ER, OUTPUT); pinMode(BY, OUTPUT); pinMode(EG, OUTPUT); pinMode(WR, OUTPUT); pinMode(WY, OUTPUT) pinMode(WG, OUTPUT); pinMode(SR, OUTPUT); pinMode(SY, OUTPUT); pinMode(SG, OUTPUT); pinMode(NR, OUTPUT); pinMode(NY, OUTPUT); pinMode(NG, OUTPUT); void loop() { east(): west(); south(); north(); void east) digitalWrite(ER, HIGH); digitalWrite(EY, LOW) digitalWrite(EG, LOW); delay( 120000); digitalWrite(ER, LOW); digitalWrite(EY, HIGH); digitalWrite(EG, LOW); delay(10000) digitalWrite(ER, LOW); digitalWrite(EY, LOW); digitalWrite(EG, HIGH); delay(50000); > void west() { digitalWrite(WR, HIGH); digitalWrite(WY, LOW); digitalWrite(WG, LOW); delay(117000); digitalWrite(WR, LOW); digitalWrite(WY, HIGH); digitalWrite(WG, LOW) delay (9000); digitalWrite(WR, LOW); digitalWrite(WY, LOW); digitalWrite(WG, HIGH); delay(55000); void loop() east west(); south(); north(); void cast) digitalWrite(ER, HIGH); digitalWrite(EY, LOW); digitalWrite(EG, LOW); delay(120000); digitalWrite(ER, LOW); digitalWrite(EY, HIGH); digitalWrite(EG, LOW); delay(10000): digitalWrite(ER, LOW); digitalWrite(EY, LOW); digitalWrite(EG, HIGH); delay(50000); > void west() digitalWrite(WR, HIGH); digitalWrite(WY, LOW); digitalWrite(WG, LOW); delay(117000); digitalWrite(WR, LOW); digitalWrite(WY, HIGH); digitalWrite(WG, LOW); delay (9000); digitalWrite(WR, LOW); digitalWrite(WY, LOW); digitalWrite(WG, HIGH); delay(55000); > void south) digitalWrite(SR, HIGH); digitalWrite(SY, LOW); digitalWrite(SG, LOW); delay(130000); digitalWrite(SR, LOW); digitalWrite(SY, HIGH); digitalWrite(SG, LOW); delay(60000); digitalWrite(SR, LOW); digitalWrite(SY, LOW); digitalWrite(SG, HIGH); delay( 7000); void north digitalWrite(NR, HIGH); digitalWrite(NY, LOW); digitalWrite(NG, LOW); delay(125000); digitalWrite(NR, LOW); digitalWrite(NY, HIGH); digitalWrite(NG, LOW); delay(8000); digitalWrite(NR, LOW); digitalWrite(NY, LOW); digitalWrite(NG, HIGH); delay(57000)

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

Database And Expert Systems Applications 19th International Conference Dexa 2008 Turin Italy September 2008 Proceedings Lncs 5181

Authors: Sourav S. Bhowmick ,Josef Kung ,Roland Wagner

2008th Edition

3540856536, 978-3540856535

More Books

Students also viewed these Databases questions

Question

Question Who can establish a Keogh retirement plan?

Answered: 1 week ago