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

USING ENERGIA PLEASE SHOW ME HOW TO DO ALL 4 PARTS Hw05-1 Develop an algorithm w

ID: 2248022 • Letter: U

Question

USING ENERGIA PLEASE SHOW ME HOW TO DO ALL 4 PARTS

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

HW 05-4)

*
Pin 3 has an LED connected on MSP430 boards, has a name 'GREEN_LED' in the code.
Pin 2 has an LED connected on MSP430 boards, has a name 'RED_LED' in the code.
*/

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(RED_LED, OUTPUT);   
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(RED_LED, HIGH); // turn the RED LED on (HIGH is the voltage level)
digitalWrite(GREEN_LED, LOW); // turn the GREEN LED off by making the voltage LOW
delay(500); // wait for 500ms
digitalWrite(RED_LED, LOW); // turn the RED LED off by making the voltage LOW
digitalWrite(GREEN_LED, HIGH); // turn the GREEN LED on (HIGH is the voltage level)
delay(500); // wait for 500ms