Arduino: RTC DS3231 hack
Source #include "Wire.h" #define DS3231_I2C_ADDRESS 0x68 // Convert normal decimal numbers to binary coded decimal byte decToBcd(byte val) { return ( (val / 10 * 16) + (val % 10) ); } // Convert binary coded decimal to normal decimal numbers byte bcdToDec(byte val) { return ( (val / 16 * 10) + (val % 16) ); } void setup() { Wire.begin(); Serial.begin(9600); // set the initial time here: // DS3231
| Penerbit | Taratsa |
|---|---|
| Tahun | 2018-06-07 |
| Bahasa | ind |
| Pengenal | bookid: urn:uuid:60b3350b-ce61-50c6-815b-7f6bc9fcde22 |