STM32L152RC 在keil4中使用printf()和scanf() 函数
1、在keil中配置使用Micro LIB,如下图

2、配置USART模块
void SYS_USARTInit(void)
{
static USART_InitTypeDef USART_InitStructure;
static GPIO_InitTypeDef GPIO_InitStructure;
USART_InitStructure.USART_BaudRate = 115200;
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
USART_InitStructure.USART_StopBits = USART_StopBits_1;
USART_InitStructure.USART

本文详细介绍了如何在STM32L152RC的keil4环境下,通过配置Micro LIB、设置USART模块以及重定向printf()函数,成功使用printf()和scanf()进行串口通信。
最低0.47元/天 解锁文章
7810

被折叠的 条评论
为什么被折叠?



