if(rtc_buf[0]%5==0 && prev_value != rtc_buf[0])
{
prev_value = rtc_buf[0];
write_EEPROM(address,hour);
address++;
write_EEPROM(address,minute);
address++;
write_EEPROM(address,second);
address++;
write_EEPROM(address,m);
address++;
write_EEPROM(address,n);
address++;
if(address>60000)address=0;
}
RB7=0;
//read_address=0;
if(RB7==1)
{
//read_address =0;
p=read_EEPROM(read_address);
read_address++;
q=read_EEPROM(read_address);
read_address++;
r=read_EEPROM(read_address);
read_address++;
RxByte=read_EEPROM(read_address);
read_address++;
RxByte1=read_EEPROM(read_address);
txt1(p+0x30);
txt1(10);
txt1(13);
txt1(q+0x30);
txt1(10);
txt1(13);
txt1(r+0x30);
txt1(10);
txt1(13);
z=((RxByte<<8)|RxByte1);
// Converting sample value to temperature
T=(z*0.48876);
Temp1 = (unsigned int)((T/100)%10); // 1st digit
Temp2 = (unsigned int)((T/10)%10); // 2nd digit
Temp3 = (unsigned int)((T/1)%10); // 3rd digit
// Displaying temperature in lcd
lcdcommand(0xcd);
if(T<=99)
{
lcddata(' '); // displaying the 1st digit
lcddata(Temp2+0x30); // displaying the 2nd digit
lcddata(Temp3+0x30); // displaying the 3rd digit
}
lcdcommand(0xcd);
if(T>=100)
{
lcddata(Temp1+0x30); // displaying the 1st digit
lcddata(Temp2+0x30); // displaying the 2nd digit
lcddata(Temp3+0x30); // displaying the 3rd digit
// lcddata('C');
}
txt1(Temp1+0x30);
txt1(Temp2+0x30);
txt1(Temp3+0x30);
txt1(10);
txt1(13);
read_address++;
}