全新论坛MCU智学网上线,欢迎访问新论坛!稀缺资源、技术干货、参考设计、原厂资料尽在MCU智学网
更新自动建库工具PCB Footprint Expert 2023.13 Pro / Library Expert 破解版

WinAVR中无法正确使用 sprintf函数是为什么?

[复制链接]
2162 0

本文包含原理图、PCB、源代码、封装库、中英文PDF等资源

您需要 登录 才可以下载或查看,没有帐号?注册会员

x
我使用sprintf在WinAVR中把int 转换成字符串后,在LCD1602无法正常显示。
#include <avr/interrupt.h>
#include "lcd1602.h"
#include "stdio.h"
#include "string.h"
#include "stdlib.h"
uchar tabel_miao[4];
uchar tabel_fen[4];
uint miao=123;
uint fenn=456;
int main(void)
{
     sprintf(tabel_miao, "%s",miao);
        sprintf(tabel_fen, "%s",fenn);

        Port_Init();       
     LCD1602Init();
     _delay_ms(100);  
        LCD1602MoveToPosition(0,0);
        _delay_ms(20);
        LCD1602PrintString(tabel_fen); //这个出错,如果我对tabel_fen字符数组直接赋值是正常的。

}
请教是什么原因?

举报

回复
*滑块验证:
您需要登录后才可以回帖 登录 | 注册会员

本版积分规则

打开支付宝扫一扫,最高立得1212元红包
搜索

图文热点

更多

社区学堂

更多

客服中心

QQ:187196467 服务时间:周一至周日 8:30-20:30

关注我们

关于我们
关于我们
友情链接
联系我们
帮助中心
网友中心
购买须知
支付方式
服务支持
资源下载
售后服务
定制流程
关注我们
官方微博
官方空间
官方微信
快速回复 返回顶部 返回列表