这样的程序行不行。。
__interrupt void ADC12ISR (void)
{
uint index=0;
A0results[index] = ADC12MCTL0;
A1results[index] = ADC12MCTL1;
A2results[index] = ADC12MCTL2;
index = (index+1)%Num_Result;
if(index ==0)
{
for(i=0;1<=20,i++)
{
sum_0=A0results[i]+sum_0;
sum_1=A0results[i]+sum_1;
sum_2=A0results[i]+sum_2;
AO=sum_0/20;
A1=sum_2/20;
A2=sum_3/20;
}
}
} |