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

Using microcontroller MSP430, for 4 roads intersection: Develop the code to set

ID: 2292967 • Letter: U

Question

Using microcontroller MSP430, for 4 roads intersection: Develop the code to set the fixed cycle time of 100s with the Green LED ON time of 22s, Yellow LED ON time of 3s ( 2s for changing from Green to Red and 1s for changing from Red to Green) and RED LED on time of 75s.for each road in the intersection. Using microcontroller MSP430, for 4 roads intersection: Develop the code to set the fixed cycle time of 100s with the Green LED ON time of 22s, Yellow LED ON time of 3s ( 2s for changing from Green to Red and 1s for changing from Red to Green) and RED LED on time of 75s.for each road in the intersection. Using microcontroller MSP430, for 4 roads intersection: Develop the code to set the fixed cycle time of 100s with the Green LED ON time of 22s, Yellow LED ON time of 3s ( 2s for changing from Green to Red and 1s for changing from Red to Green) and RED LED on time of 75s.for each road in the intersection.

Explanation / Answer

#include <msp430g221.h>

void main (void)

{

WDTCTL=WDTFW+WDTHOLD;

if (CALBC1_1MHz ==0xFF|| CALDCO_1 MHz==0xFF)

{

while(1);

}

BCSCT1=CALBC1_1MHz;

DCOCTL=CALDCO_1 MHz;

P1DIR=0X40;

P1OUT=0;

while(1)

{

P1OUT=0X40;

_delay_cylces(22000); // red

P1OUT=0;

_delay_cylces(75000); // green

}

}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote