#include
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P2DIR = BIT7; // P2.7output
TBCCTL0 = CCIE; // CCR0 interrupt enabled
TBCCR0 = 50000;
TBCTL = TBSSEL_2 + MC_2; // SMCLK, contmode
_BIS_SR(LPM0_bits + GIE); // Enter LPM0 w/ interrupt
}
void Timer_B (void)
{
P2OUT ^= BIT7; // Toggle P3.4
TBCCR0 += 50000; // Add Offset to CCR0
}
用定时器每隔一段时间,取反转P2.7脚
http://shop34182318.taobao.com/
https://shop436095304.taobao.com/?spm=a230r.7195193.1997079397.37.69fe60dfT705yr