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

PLEASE SHOW ME HOW TO DO THIS USING ENERGIA. THANK YOU Hw05-1 Develop an algorit

ID: 3886322 • Letter: P

Question

PLEASE SHOW ME HOW TO DO THIS USING ENERGIA. THANK YOU

Hw05-1 Develop an algorithm which generates an infinite loop with two LED outputs Each iteration is approximately 1 second. · o Define one variable, LED1, for the Red LED. o Define another variable, LED2, for the Green LED. .The Red LED turns ON for 500ms, then turns OFF 500ms, every iteration. . The Green LED turns ON when the Red LED is OFF, and OFF when the Red LED is ON. Document this algorithm using a flowchart or pseudo-code » For a flowchart, use an online tool such as "draw.io" (or powerpoint). Hand-written drawings (sketches) ARE NOT acceptable for this HW assignment.

Explanation / Answer

HW05-1

An Algorithm that generates infinite loop with two led output

Step1: Variable LED_RED pinMode(LED1, OUTPUT);
Step2: Variable LED_GREEN pinMode(LED2, OUTPUT);
Step3 : Start Loop

Step 4: digitalWrite(LED1, HIGH); turn the RED LED on (HIGH is the voltage level)
Step 5: delay(500); // wait for a second
Step 6: digitalWrite(LED1, LOW); // turn the RED off by making the voltage LOW
Step 7: digitalWrite(LED2, HIGH); turn the GREEN LED on (HIGH is the voltage level)
Step 8: delay(500); // wait for a second
Step 9: digitalWrite(LED2, LOW); // turn the GREEN off by making the voltage LOW
Step 10: goto Step4