![]() ![]() To set the breakout board to 12-hour mode, you would just send a logic HIGH for bit 6 for the hour timekeeping register. They are just using the DC1307 in 24-hour mode. Looking at the example code from the bildr tutorial provided, it does not show how to set it. ![]() This is explained on page 8 of the datasheet. Looking at the datasheet for the breakout board, there is an option to set the mode as either 12 hour or 24 hours. Through this method, it is a little bit more complicated to set DS1307 to 12-hour mode. Setting Bit 6 for the Hour Timekeeper Register 0x02 if greater than 12 hours, subtract before displaying the hour variable if less than or equal to 12 hours, display 12 hour You can write this statement around the line 48 in the first block of code from the bildr tutorial where the data is outputting to the serial monitor similar to this. I would write an additional variable to show that the time is either AM or PM. Just write the code to subtract 12 hours using an if/else statement if the value is greater than 11:59am in order to display the time as 12 hours. Using condition statements, you can display the data in "12-hour" mode. Through this method, you would just need to process the received values from the DS1307 to display as a 12 hour value without needing to change the hour register. There are two options to display the clock as a 12-hour mode using an Arduino: Tech Support Tips/Troubleshooting/Common Issues For the SQW pin, we recommend doing using a logic level converter since the GPIO for the Raspberry Pi is 3.3V. For the SQW pin, we recommend doing using a logic level converter or voltage divider since the I/O of the Arduino is 3.3V.įor a Raspberry Pi, you can remove the solder jumpers for the pull-up resistors so that you can just use the Raspberry Pi’s internal pull-up resistors. Otherwise, you might want to use a dedicated I2C logic level converter for the I2C pins =>. You might be able to get away with just connecting the RTC to your 3.3V Arduino because of the open drain drivers =>. You would need to do some modifications before being able to use it with a 3.3V system. The supply voltage for the RTC DS1307 needs to have a 5V input so it is not directly compatible with a 3.3V device (like a 3.3V Arduino or a Raspberry Pi). ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |