IMG_20130322_213649.jpg (1.16 MB, 下载次数: 0)
下载附件
2013-3-22 21:41 上传
请看第一行的最后两个字符,倒数第二个还查不到啊
//在1602上显示日期时间函数
void Time_Disp(unsigned char * date ,unsigned char * time)
{
//LCD_send_command(0x01); //清屏
//年
LCD_write_char(0,0,'2');
LCD_write_char(0,1,'0');
LCD_write_char(0,2,date[0]/10+0x30);
LCD_write_char(0,3,date[0]%10+0x30);
LCD_write_char(0,4,'-');
//月
LCD_write_char(0,5,date[1]/10+0x30);
LCD_write_char(0,6,date[1]%10+0x30);
LCD_write_char(0,7,'-');
//日
LCD_write_char(0,8,date[2]/10+0x30);
LCD_write_char(0,9,date[2]%10+0x30);
LCD_write_char(0,10,' ');
//时
LCD_write_char(0,11,time[1]/10+0x30);
LCD_write_char(0,12,time[1]%10+0x30);
LCD_write_char(0,13,':');
//分
LCD_write_char(0,14,time[0]/10+0x30);
LCD_write_char(0,15,time[0]%10+0x30);
}
这个不能保证值是正确的,只能保证不显示未知字符,如果加%60就变成“45”一直在跳了
一周热门 更多>