51单片机C语言中使用printf函数需要设置什么?

如题所述

其实和直接的串口发送是一样的#include <intrins.h 包含进去tp=ADCRead(adr);读取AD转换的值sprintf(str, "AD Result is: %dmV \r", tp);str是个char型数组再调用你编写的串口发送字符串程序发送strvoid sentstr(uchar *str){ while(1) { if(*str='\0')break; putbuffer(*str++); }}sentstr(str); 51单片机中没有printf这个函数,你如果想用串口发送的话,要自己去写一个串口发送函数就可以了。
温馨提示:内容为网友见解,仅供参考
无其他回答
相似回答
大家正在搜