以下是一份基于STM32F103C8T6的AD采集电压信号并通过串口输出的示例代码,您可以参考使用:
#include "stm32f10x.h"
#include "stdio.h"
GPIO_InitTypeDef GPIO_InitStructure;
USART_InitTypeDef USART_InitStructure;
ADC_InitTypeDef ADC_InitStructure;
void USART1_Init(void)
{
RCC_APB2PeriphClockCmd(RCC_APB2Periph_USART1 | RCC_APB2Perip