i
cludereg52hi
cludei
tri
shdefi
eLCD_DataP0defi
eucharu
sig
edcharu
sig
edcharsecmi
hourdaymo
thyearce
week
extaabbccddmmtemp0Lu
arMo
thLu
arDayLu
arYeari
ttempuchartt1bitc_moo
bitce
bit1bitwsbitLCD_RSP20sbitLCD_RWP21sbitLCD_EP22sbitPSBP23sbitDS1302_CLKP37sbitDS1302_IOP36sbitDS1302_RSTP35sbitDS18B20P25sbitspeakP27sbitSetKeyP14按键功能:设置sbitSureKeyP15按键功能:确认sbitPlusKeyP16按键功能:加sbitReduceKeyP17按键功能:减sbitsclP11sbitsdaP10voidDisplayShe
gXiaovoidvoiddelayu
sig
edi
ta延时1MS次u
sig
edchariwhileafori0i125i
fvoiddelaybu
sig
edi
tcou
twhilecou
tvoiddelaysvoidstartsda1scl1delayssda0delaysvoidstopsda0scl1delayssda1delaysvoidrespo
seuchariwhilesda1i255i给应答信号sda0;错误(while((sda0)i255)i;)程序进入while死循环scl1delaysscl0没有这一步出错,如果没有sda将保持0状态,一直处于应答中。程序停止。delaysvoidwrite24c02uchardateuchartempitempdatefori0i8iscl0sdatemp0x80delays
fscl1delaystemptemp1scl0delayssda1delaysucharread24c02ucharkiscl0delayssda1仅仅是释放数据线,可有可无fori0i8iscl1delayskk1ifsdakscl0delaysretur
kvoidwrite_24c02adducharaddressuchardatestartwrite24c020xa0respo
sewrite24c02addressrespo
sewrite24c02daterespo
sestopucharread_24c02adducharaddressucharastartwrite24c020xa0
frespo
sewrite24c02addressrespo
sestartwrite24c020xa1respo
searead24c02stopretur
au
sig
edcharDS18B20I
itu
sig
edcharxDS18B201delayb2DS18B200delayb80DS18B201delayb5xDS18B20delayb20retur
xu
sig
edcharTempReadvoidu
sig
edcharidatDS18B201delayb1fori0i8iDS18B200datdat1DS18B201ifDS18B20datdat0x80delayb4retur
datvoidTempWriteByteu
sig
edchardatu
sig
edi
tiDS18B201delayb2fori0i8i
fDS18B200DS18B20dat0x01delayb8DS18B201datdat1delayb2i
tGetTempfloatttu
sig
edcharabDS18B20I
itTempWriteByte0xccTempWriteByte0x44delayb100DS18B20I
itTempWriteByte0xccTempWriteByte0xbedelayb200aTempReadbTempReadtempbtemp8temptempatttemp00625temptt1005retur
tempvoidWriteDs1302Byteu
sig
edchartempu
sig
edcharifori8i0iDS1302_IOtemp0x01DS1302_CLK0DS1302_CLK1temp1voidWriteDs1302u
sig
edcharaddressu
sig
edr