[Raspberry Pi 3B+ Review] Open I2C peripheral interface & drive DS3231[Copy link]
This post was last edited by donatello1996 on 2018-12-24 00:05 This post uses a very simple method to use the Raspberry Pi to communicate with the I2C device. The device is selected as the DS3231 with the I2C interface. Simply connect the DS3231 to the I2C-1 interface:
You can see that the first seven registers of DS3231 are time data, from 0x01 to 0x07, they are seconds, minutes, hours, days, months, and years. Then load the wiringPi library, read the time from the program and display it: #ifndef _DS3231_H_ #define _DS3231_H_ #include