esp8266 arduino调试遇到问题记录

1、下载未运行; -- usb转串口小板问题,板子上跳冒要接5V,杜邦接VCC3.3;
2、串口显示乱码;-- utf-8编码,3个字节表示一个汉字,可用secureCRT设置下编码为utf-8显示(Options->Session Options->Terminal->Appearance)

问题:
cannot pass objects of non-trivially-copyable type 'class String' through '...'
原因:
printf只能输出c语言的数据,string不是,所以报错;

解决:
用string的成员函数c_str()转换后即可用printf输出,如
char buf[] = "abc";
string str = buf;

printf("%s",str.c_str());
 

猜你喜欢

转载自blog.csdn.net/hxl5955/article/details/111396292