void SC_ADC_Init(void)
{
/*ADC_Init write here*/
ADC_Init(ADC_PRESSEL_3CLOCK, ADC_Cycle_Null);
/*AIN2口模式设置*/ADC_EAINConfig(ADC_EAIN_2, ENABLE);
ADC_ChannelConfig(ADC_CHANNEL_2, ENABLE);
ADC_ITConfig(ENABLE, LOW);
ADC_Cmd(ENABLE);
}
void ADC_Data(void)
{
while(1)
{
ADCValue = ADC_GetConversionAverageValue(ADC_SamplesNum_EightTimes);
printf("ADC通道2的采样值为%d\r\n",ADCValue);
Delay(1000);
}
}
|