完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
#include #include #define uchar unsigned char #define uint unsigned int unsigned char temp[8]; unsigned char dispcount; unsigned char T0count; unsigned char timecount; bit flag; unsigned long x; unsigned char TempBuffer[10]; ***it lcde=P2^7; //使能端 ***it lcdrs=P2^6; //复位端 ***it lcdrw=P2^5; //写数据端 void IntToStr(unsigned int t, unsigned char *str, unsigned char n) { unsigned char a[5]; char i, j; a[0]=(t/10000)%10; //取得整数值到数组 a[1]=(t/1000)%10; a[2]=(t/100)%10; a[3]=(t/10)%10; a[4]=(t/1)%10; for(i=0; i<5; i++) //转成ASCII码 a=a+'0'; for(i=0; a=='0' && i<=3; i++); for(j=5-n; j { *str=' '; str++; } for(; i<5; i++) { *str=a; str++; } //加入有效的数字 *str=' |