CodePudding user response:
Thanks for invitation, but I'm sorry, never use this kind of chicken, eggCodePudding user response:
Void ADC_init (){
P6SEL |=BIT3 + BIT4;
ADC12CTL0=ADC12ON + ADC12SHT0_1 + ADC12MSC;
ADC12CTL1=ADC12SHP + ADC12CONSEQ_1;
ADC12MCTL3=ADC12INCH_3;
ADC12MCTL4=ADC12INCH_4 + ADC12EOS;
ADC12CTL0 |=ADC12ENC;
}
While (1)
{
ADC12CTL0 |=ADC12SC;
while(! (ADC12IFG1 & amp; BIT1));
V_date=ADC12MEM3;
V_date1=ADC12MEM4;
}