I2C and DS1307 real-time clock IC

I went through a youtube video on understanding I2C and how I can use it with Arduino. One part of the video that completely went over my head was the part when they are using the register to access hr,min, and sec. I do not understand how he came up with the hex codes the way he did. Here is the data sheet link and his code :

Data sheet link: HTTP 301 This page has been moved
void settime(){// SET TIME
Wire.beginTransmission(B1101000);
Wire.send(0x00);
Wire.send(0x55);//sec
Wire.send(0x59);//min
Wire.send(B01101001);//HOUR
Wire.endTransmission();
}//

I went through a youtube video on understanding I2C and how I can use it with Arduino. One part of the video that completely went over my head was the part when they are using the register to access hr,min, and sec. I do not understand how he came up with the hex codes the way he did. Here is the data sheet link and his code :

Data sheet link: HTTP 301 This page has been moved
void settime(){// SET TIME
Wire.beginTransmission(B1101000);
Wire.send(0x00);
Wire.send(0x55);//sec
Wire.send(0x59);//min
Wire.send(B01101001);//HOUR
Wire.endTransmission();
}//

What video? Anyway as I recall the DS1307 uses Binary-coded decimal (BCD) ... Google that.

So in your examples, 0x55 would be 55 seconds, and 0x59 would be 59 minutes.

As for the hour, taking the bits:

Wire.send(B01101001);//HOUR

The low-order 4 bits will be 9 so it is 9 am or 9 pm.

Since bit 6 is a 1 it is am/pm mode. And since bit 5 is a 1 it is pm. So, 9 pm.

are those values not BCD encoded, that makes 55 seconds 0101 0101 which is 0x55
BCD uses 4 bits to store a digit.

Have a look here:

Hope that helps!

http://arduino.cc/forum/index.php/topic,98851

Did you not comprehend my answer to the EXACT same question earlier today? Please don't double post like that.

@OP:

DO NOT CROSS-POST.
It wastes time.