51uwb.cn

 找回密码
 立即注册
查看: 3037|回复: 1

OLED _String函数显示问题

[复制链接]

3

主题

22

帖子

63

积分

注册会员

Rank: 2

积分
63
发表于 2020-3-14 21:35:11 | 显示全部楼层 |阅读模式
if(Anthordistance_count[0]>0&&Anthordistance_count[0]<7)
     {
         sprintf(dist_str, "serious_injury:%3.2fm", (float)Anthordistance[0]/1000);      
         OLED_ShowString(0, 2,dist_str);
     serious_injury;
     
     }
    else if(Anthordistance_count[0]>7&&Anthordistance_count[0]<15)
   {   sprintf(dist_str, "slight_injury:%3.2fm", (float)Anthordistance[0]/1000);      
         OLED_ShowString(0, 2,dist_str);
     slight_injury;}
     if(Anthordistance_count[1]>0&&Anthordistance_count[1]<7)
     {
         sprintf(dist_str, "serious_injury:%3.2fm", (float)Anthordistance[1]/1000);      
         OLED_ShowString(0, 4,dist_str);
     serious_injury;}为什么显示屏依旧显示:an0: xxx m,而不是我代码中 sprintf(dist_str, "slight_injury:%3.2fm", (float)Anthordistance[0]/1000);      
         OLED_ShowString(0, 2,dist_str);程序没有烧录进去吗
回复

使用道具 举报

22

主题

55

帖子

790

积分

管理员

Rank: 9Rank: 9Rank: 9

积分
790
发表于 2020-3-16 11:35:56 | 显示全部楼层
这个现实部分是tag 代码
你编译的时候看看是否编译了tag

还有,你可在main 函数开始改,看看能不能改进去
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

bphero Inc.  

GMT+8, 2024-3-29 16:39 , Processed in 0.011206 second(s), 4 queries , File On.

Powered by Discuz! X3.3

© 2001-2017 Comsenz Inc. Template By 【未来科技】【 www.wekei.cn 】

快速回复 返回顶部 返回列表