开发环境(蓝色粗体字为特别注意内容)
1,开发板:89C52RC。
2,开发环境:Keil uv5
在51单片机的KEIL程序中,使用printf("Voltage0:%d\r\n",123);串口打印输出,发现数据异常。
输出31488
Keil C51中的printf()与标准的C库的printf()函数稍有不同,在相应的帮助文档中有如下描述:
The optional characters l or L may immediately precede the type character to respectively specify long types for d, i, u, o, x, and X.
The optional characters b or B may immediately precede the type character to respectively specify char types for d, i, u, o, x, and X.
也就是说,使用