kopia lustrzana https://github.com/peterhinch/micropython-samples
Comment correction @ save_time function
See: https://docs.python.org/3.8/library/time.html#time.struct_time `6 | tm_wday | range [0, 6], Monday is 0`pull/29/head
rodzic
2247e86ff1
commit
be93f1ec56
|
@ -73,7 +73,7 @@ class DS3231:
|
|||
self.ds3231.writeto_mem(DS3231_I2C_ADDR, 0, tobytes(dec2bcd(ss)))
|
||||
self.ds3231.writeto_mem(DS3231_I2C_ADDR, 1, tobytes(dec2bcd(mm)))
|
||||
self.ds3231.writeto_mem(DS3231_I2C_ADDR, 2, tobytes(dec2bcd(hh))) # Sets to 24hr mode
|
||||
self.ds3231.writeto_mem(DS3231_I2C_ADDR, 3, tobytes(dec2bcd(wday + 1))) # 1 == Monday, 7 == Sunday
|
||||
self.ds3231.writeto_mem(DS3231_I2C_ADDR, 3, tobytes(dec2bcd(wday + 1))) # 0 == Monday, 6 == Sunday
|
||||
self.ds3231.writeto_mem(DS3231_I2C_ADDR, 4, tobytes(dec2bcd(mday))) # Day of month
|
||||
if YY >= 2000:
|
||||
self.ds3231.writeto_mem(DS3231_I2C_ADDR, 5, tobytes(dec2bcd(MM) | 0b10000000)) # Century bit
|
||||
|
|
Ładowanie…
Reference in New Issue