1个回答
展开全部
#include <msp430x16x.h>
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
P4DIR = 0x01;
P1OUT ^= 0x01; //P1.0取反
}
void main( void )
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= 0x01; // P1.0设为输出脚
P4DIR |= 0x01;
TACTL = TASSEL_1 + MC_1;
CCR0=200;
CCTL0 = CCIE; // CCR0中断使能
_EINT();
LPM3;
}
#pragma vector=TIMERA0_VECTOR
__interrupt void Timer_A (void)
{
P4DIR = 0x01;
P1OUT ^= 0x01; //P1.0取反
}
void main( void )
{
WDTCTL = WDTPW + WDTHOLD;
P1DIR |= 0x01; // P1.0设为输出脚
P4DIR |= 0x01;
TACTL = TASSEL_1 + MC_1;
CCR0=200;
CCTL0 = CCIE; // CCR0中断使能
_EINT();
LPM3;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询