Write CCS(code composer studio) command for The microcontroller(MSP430g2553). It will wait for a button push with the red LED on and Green Led off. Once the button is pushed, the red led will go off, and green LED will light for 5 seconds. (Use a slight delay here (specific timing not specified). During that time, the MCU will keep track of button pushes. After 5 seconds, it will blink the red LED t he same number of times that were counted. The flashing rate of the led will be approxima tely 2 flashes per second. It will then return to the initial state with the Red led on and Green off, waiting for a button push.
BLINKING AN LED:
while(TRUE)
{
PIN_setOutputValue(hPin,Board_LED0,IOID_10);
Task_sleep (delaybyDurationUs / Clock_tickPeriod);
PIN_setOutputValue(hPin,Board_LED0,IOID_0);
Task_sleep (delaybyDurationUs / Clock_tickPeriod);
PIN_setOutputValue(hPin,Board_LED1,IOID_15);
Task_sleep (delaybyDurationUs / Clock_tickPeriod);
PIN_setOutputValue(hPin,Board_LED1,IOID_0);
Task_sleep (delaybyDurationUs / Clock_tickPeriod);
}
}
Give delay as per your requirement
Get Answers For Free
Most questions answered within 1 hours.