ESP8266 使用笔记(五) 串口输出helloWord

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/P_xiaojia/article/details/82558944

使用原生SDK输出 串口hello
SDK版本:esp8266_nonos_sdk-2.2.0
这里写图片描述
这里写图片描述
注意串口助手的波特率(不配置波特率的话系统上电默认765000)
这里写图片描述

另一种输出方法

uart_init(115200,115200)
uart0_sendStr(”\r\nhello world\r\n”);
/********************************************************************
* FunctionName : uart0_sendStr
* Description : use uart0 to transfer buffer
* Parameters : uint8 *buf - point to send buffer
* uint16 len - buffer len
* Returns :
*********************************************************************/
void ICACHE_FLASH_ATTR
uart0_sendStr(const char *str)
{
while(*str){
uart_tx_one_char(UART0, *str++);
}
}

这里写图片描述

乱码不可避免,初始波特率都在74800左右
这里写图片描述

猜你喜欢

转载自blog.csdn.net/P_xiaojia/article/details/82558944