Hi,
I am trying to set port P8.7 high for a period of time (e.g 10s), and then set the same port P8.7 low.
My objective is to set it high to turn on a motor for 10s and then set it to low to turn the motor off.
Code used to set port high:
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer
P8REN |= BIT7; // enable internal pull up, 6
//P8OUT &= ~BIT7; // P1.0 low
P8OUT |= BIT7; // P1.0 high
P8SEL &= ~BIT7; // configure P1.0 for digital I/O
P8DIR |= BIT7; // configure P1.0 as output
//P8OUT &= ~BIT7; // P1.0 low
P8OUT |= BIT7; // P1.0 high
while(1);
}
Any help is appreciated.
Thank you