Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

! I\'m doing the final project for me Engineering class, my teacher asked me wri

ID: 3834559 • Letter: #

Question

! I'm doing the final project for me Engineering class, my teacher asked me write a code (C++) for some idea below, or you can get another idea from internet. Making sure it can run

***Here are some ideas from what students have done in the past for projects:

***I encourage you to look online for ideas and even code.

***Because there are just a few weeks to do this project, don't make it too ambitious such that you run out of time. Just to gain familiarity with a new language or with an Arduino project for example will give you a feel for how software works in the real world. Another idea for a project is to use Matlab programming constructs such as IF statements, FOR loops, WHILE loops. Recall that we used them in Excel VBA programming.

Explanation / Answer

void loop(){ changeLights(); delay(15000); } void changeLights(){ // green off, yellow on for 3 seconds digitalWrite(green, LOW); digitalWrite(yellow, HIGH); delay(3000); // turn off yellow, then turn red on for 5 seconds digitalWrite(yellow, LOW); digitalWrite(red, HIGH); delay(5000); // red and yellow on for 2 seconds (red is already on though) digitalWrite(yellow, HIGH); delay(2000); // turn off red and yellow, then turn on green digitalWrite(yellow, LOW); digitalWrite(red, LOW); digitalWrite(green, HIGH);