stm32f207多通道数据采集转换例程
#include "main.h"
unsigned int i = 0;
float f_adc_value[ADC_CHANNLE_NUM];
int main(void)
{
LED_Configuration();
ADC_Configuration();
USART_Configuration();
SysTick_Configuration();
printf("ADC²É¼¯ÊµÑé\n");
while (1)
{
if(time_flag == 1)//Ô¼500msÊä³öÒ»´Î
{
time_flag = 0;
GPIO_ToggleBits(LED4);
for(i = 0;i < ADC_CHANNLE_NUM;i ++)
{
f_adc_value[i] = ADC_RCVTab[i] * 3.3 / 4096.0;
printf("%4.2f ",f_adc_value[i]);
}
printf("\r\n");
}
}
}
1