adc_task.c
392 Bytes
#include "hardware.h"
#include "delay.h"
#include "sys.h"
#define ADCen 0u
void adc_task(void *pdata)//模拟量口采集信息
{
#if ADCen
while(1)
{
Voltage1=((float)Get_Adc_Average(ADC_Channel_4,2))/4096*3.3f*3.2f; //获取实际电压值1
// Voltage2=((float)Get_Adc_Average(ADC_Channel_5,20))/4096*3.3f*3.2f; //获取实际电压值2
OSTimeDly(10);
}
#endif
}