回复 6楼 Domen 的帖子
void main(void)
{
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
ADC10CTL1 = INCH_1 + ADC10DIV_0 + CONSEQ_3; // Temp Sensor ADC10CLK/4
ADC10CTL0 |= ADC10ON + ADC10IE + REFON + REF2_5V + SREF_1 + MSC + ADC10SHT_2;
ADC10AE0 = 0X03; //P1.0 P1.1 analog enable
ADC10DTC1|=0X0a;
delay_us(40);
//LCD初始化
LCD_init_first();
LCD_init();
while(1)
{
ADC10CTL0 &= ~ENC;//关闭采样使能
while(ADC10CTL1 & ADC10BUSY);//判断是否有采样或转换动作
ADC10CTL0 |= ADC10SC + ENC;//开始采样
ADC10SA = (uint)a;
_EINT();//关闭CPU,开启总中断
LPM0;
for(num1=0;num1<2;num++)
{
for(num=0;num<5;num++)
{
b[num1]+=a[num1+num*2];
}
}
P10=b[1]/5;
P11=b[0]/5;
display();
P10_v=P10/1023*2.5;
P11_v=P11/1023*2.5;
display_v_P10(P10_v);
display_v_P11(P11_v);
}
}
// ADC10 interrupt service routine
#pragma vector=ADC10_VECTOR
__interrupt void ADC10_ISR (void)
{
LPM0_EXIT;// Clear CPUOFF bit from 0(SR)
}
我照着大虾写的程序来的,可是为什么没有反映呢?求助!!!