Question: Help modify below code using the timer Timer_A to toggle two LEDs in periodic time intervals of A)10 sec B)30 sec C)1 sec the original

Help modify below code using the timer Timer_A to toggle two LEDs in periodic time intervals of A)10 sec B)30 sec C)1 sec

the original code toggled red LED when an overflow occured:

#include #define RedLED BIT0 #define RedLEDToggle (P1OUT ^= RedLED) void main (void) { WDTCTL = WDTPW|WDTHOLD; P1DIR = RedLED; P1OUT = RedLED; TECTL = TASSEL_2|ID_3|MC_3|TAIE; TACCR0 = 62500; _enable_interrupts(); LPM1; //enter low power mode } #pragma vector=TIMER_A1_VECTOR __interrupt void Timer_A(void) { switch(TAIV) { case 0x02: break; case 0x04: break; case 0x0A; RedLEDToggle; break; } }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!