|
函数如下:
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR_HOOK(void)
{
/* ADC10 Interrupt Handler */
ISR_ADC();
/* Enter active mode on exit */
__bic_SR_register_on_exit(LPM4_bits);
}
void ISR_ADC(void)
{
static temp=0;
if (!temp)
{
P1DIR |= BIT5;
P1OUT |= BIT5;}
temp++;
if(temp/2==0)
P1OUT ^= BIT5;
P1OUT ^= BIT4;
ADC10CTL0 |= ENC;
ADC10CTL0|=ADC10SC;
}
我用的是grace生成的g2553单片机,BIT4和BIT5都接了LED,但是只能闪一下就不亮了。。。求大神帮助啊~~~
|
|