Something About Return Value Of Master_readByte(addr)
if you defined a unsigned char variable to save the values from
Master_readByte(addr).it's value equal to ASCII,the value printf to screen
used "%c" is ASCII codes! But,with using "%d" unexpected value will occour!
if your defined a int variable to save the values from Master_readByte(addr).
As we all know,a int needs 16 bits in Keil C51,the 8 bits of MSB are real value of
Master_readByte(addr). And the 8 bits of LSB are all zeros.So,when using printf()
with "%c" unexpected value will occour! Using printf() with "%d" ,the value printed
is the real value multiply 256. Also we can use _iror_( ,8) function,then printf
with "%c".The value printed is a char's(ACII) corresponding decimalism(DEC)value.
Using printf() with "%d",print the real value.
西天取经的熊猫
- 粉丝: 2293
- 资源: 56
最新资源
- 光储并网VSG系统Matlab simulink仿真模型,附参考文献 系统前级直流部分包括光伏阵列、变器、储能系统和双向dcdc变器,后级交流子系统包括逆变器LC滤波器,交流负载 光储并网VSG系
- file_241223_024438_84523.pdf
- 质子交膜燃料电池PEMFC Matlab simulink滑模控制模型,过氧比控制,温度控制,阴,阳极气压控制
- IMG20241223015444.jpg
- 模块化多电平变器(MMC),本模型为三相MMC整流器 控制策略:双闭环控制、桥臂电压均衡控制、模块电压均衡控制、环流抑制控制策略、载波移相调制,可供参考学习使用,默认发2020b版本及以上
- Delphi 12 控件之FlashAV FFMPEG VCL Player For Delphi v7.0 for D10-D11 Full Source.7z
- Delphi 12 控件之DevExpressVCLProducts-24.2.3.exe.zip
- Mysql配置文件优化内容 my.cnf
- 中国地级市CO2排放数据(2000-2023年).zip
- smart200光栅报警程序
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
- 1
- 2
前往页