/****************************************************************************************************************
*************************
*Author:JYW
*Time:2019_02_20
*Describe:LetAllLinesOfCodeSpeak
*****************************************************/
/*********************************************
*Describe:continue2019_02_19.c
*************************/
/*********************
*Describe:24C02.h
24c02通过IIC总线接口进行操作
*************/
bit wtite = 0;
sbit sda = P2^0;
sbit scl = P2^1;
void delay0()
{
;;
}
void start()//开始信号
{
sda = 1;
delay0();
scl = 1;
delay0();
sda = 0;
delay0();
}
void stop()
{
sda = 0;
delay0();
scl = 1;
delay0();
sda = 1;
delay0();
}
void respons()
{
uchar i;
scl = 1;
delay0();
while((sda==1)&&(i<250)) i++;
scl = 0;//经过一段时间之后就会默认
delay0();
}
void init()
{
uchar num;
rd = 0;//软件将矩阵按键第4列一端置低用以分解出独立按键
dula = 0;//在使用373锁存器时个人一般将OC直接接地,当
//LE为高时,锁存器打开,LE为低时,锁存器关闭
//此时将其关闭是防止操作液晶时,数码管出现乱码
wela = 0;
lcden = 0;
fen = 0;
miao = 0;
shi = 0;
count = 0;
s1num = 0;
init_24c02();
write_com(0x38);
write_com(0x0c);
write_com(0x06);
write_com(0x01);
write_com(0x80);
for(num= 0;num<15;num++)
{
write_date(table[num]);
delay(5);
}//初始化液晶显示的字符
write_com(0x80+0x40+6);
write_date(':');
delay(5);
write_com(0x80+0x40+9);
write_date(':');
delay(5);
miao = read_add(1);
fen = read_add(2);
shi = read_add(3);
write_sfm(10,miao);
}