Question: I am programming a function for the MSP430G2 launchpad with a 20 pin microchip from Texas Instruments and the answer to the problem would be

I am programming a function for the MSP430G2 launchpad with a 20 pin microchip from Texas Instruments and the answer to the problem would be a "CountDown" function. My teacher gave us the below "Countup" function. Any hints or tips for finding the inverse of this?

void CountUp(void) { switch (currentstate) {

case 0 : currentstate = 1; P1OUT |= BIT6; P1OUT &= ~(BIT0); break;

case 1 : currentstate = 2; P1OUT &= ~(BIT6); P1OUT |= BIT0; break;

case 2 : currentstate = 3; P1OUT |= BIT6; P1OUT |= BIT0; break;

case 3 : currentstate = 0; P1OUT &= ~(BIT6); P1OUT &= ~(BIT0); 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!