Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
//Write a byte to The RTC
char WriteRTC(char Address, char Byte)
{
SendID(0b11010000);
if(SendByte(Address&0xff)==0)
return(0);
if(SendByte(Byte)==0)
return(0);
SendStop();
return(1);
}
//Read a byte from the RTC
char ReadRTC(char Address)
{
char Byte;
SendID(0b11010000);
if(SendByte(Address&0xff)==0)
return(0);
SendRestart();
if(SendByte(0b11010001)==0)
return(0);
Byte=ReceiveByte();
SendNack();
SendStop();
return(Byte);
}
void WriteClock(char *array)
{
char x;
for(x=0;x<8;x++)
WriteRTC(x,array[x]);
}
void ReadClock(char *array)
{
char x;
for(x=0;x<8;x++)
array[x] = ReadRTC(x);
}