发表于:2011/6/28 20:50:41
#0楼
extern unsigned char time_buf1[8];//空年月日时分秒周
extern unsigned char time_buf[8] ;//空年月日时分秒周
unsigned char time_buf1[8] = {20,10,6,5,12,55,00,6};//空年月日时分秒周
unsigned char time_buf[8] ; //空年月日时分秒周
像这样的数组怎么应用啊,特别是在写主函数的时候我怎样才能把time_bu1[8]的八个数放到对应时间地址在1602上显示呢
程序下载之后显示乱码,但可以看到从1302中读出来的乱码秒数在变化
郁闷当中,搞了好长时间都没搞好,我感觉我是在写主函数的时候写错了,谁能帮帮我啊 呵呵
void main()
{
init();
init1302();
inital_write1302time();
while(1)
{
read1302_time();
write1602_com(0x80);
write1602_data(time_group1[0]);
write1602_com(0x80+2);
write1602_data(time_group1[1]);
write1602_com(0x80+5);
write1602_data(time_group1[2]);
write1602_com(0x80+8);
write1602_data(time_group1[3]);
write1602_com(0x80+0x40);
write1602_data(time_group1[4]);
write1602_com(0x80+0x40+3);
write1602_data(time_group1[5]);
write1602_com(0x80+0x40+6);
write1602_data(time_group1[6]);
write1602_com(0x80+0x40+9);
write1602_data(time_group1[7]);
}
}
extern unsigned char time_buf[8] ;//空年月日时分秒周
unsigned char time_buf1[8] = {20,10,6,5,12,55,00,6};//空年月日时分秒周
unsigned char time_buf[8] ; //空年月日时分秒周
像这样的数组怎么应用啊,特别是在写主函数的时候我怎样才能把time_bu1[8]的八个数放到对应时间地址在1602上显示呢
程序下载之后显示乱码,但可以看到从1302中读出来的乱码秒数在变化
郁闷当中,搞了好长时间都没搞好,我感觉我是在写主函数的时候写错了,谁能帮帮我啊 呵呵
void main()
{
init();
init1302();
inital_write1302time();
while(1)
{
read1302_time();
write1602_com(0x80);
write1602_data(time_group1[0]);
write1602_com(0x80+2);
write1602_data(time_group1[1]);
write1602_com(0x80+5);
write1602_data(time_group1[2]);
write1602_com(0x80+8);
write1602_data(time_group1[3]);
write1602_com(0x80+0x40);
write1602_data(time_group1[4]);
write1602_com(0x80+0x40+3);
write1602_data(time_group1[5]);
write1602_com(0x80+0x40+6);
write1602_data(time_group1[6]);
write1602_com(0x80+0x40+9);
write1602_data(time_group1[7]);
}
}