DS3231 RTC library help???
Posted: Sun Dec 12, 2021 5:26 am
I initially posted this in the Raspberry pico board of this forum but I may perhaps get better results here
I have a library for the DS3231
https://github.com/Algester/Pico-Clock- ... _DS3231.py
right now I have slapped in the Month array or so I think should be the month array
with this
mon = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
and then implemented
under def DS3231_ReadTime
month = self.mon[self.bcd2bin(buffer[5])]
which I think should be able to convert the numbers into text based on the array
but somehow changing the readtime mode to 2 (where the logic should be implemented is spitting out
Error: DS3231 is not connected? on the LCD screen
while not related I also need to know how do I "convert" the date time from 24 hours to 12 hours I havent seen an example that makes it "work" every sample I see in the internet only spits out 24 hours I know it should be sent to the main.py but I just have no clear clue on how to make it work (I know I may have to do some basic math??)
and finally my issue with my am3231 driver seems to spit out float values that the LCD api doesnt seem to like... so I'm not sure if doing
lcd.putstr(int(sensor.temperature()))
is even remotely correct but seems to be the most simplest thing to do
I have a library for the DS3231
https://github.com/Algester/Pico-Clock- ... _DS3231.py
right now I have slapped in the Month array or so I think should be the month array
with this
mon = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]
and then implemented
under def DS3231_ReadTime
month = self.mon[self.bcd2bin(buffer[5])]
which I think should be able to convert the numbers into text based on the array
but somehow changing the readtime mode to 2 (where the logic should be implemented is spitting out
Error: DS3231 is not connected? on the LCD screen
while not related I also need to know how do I "convert" the date time from 24 hours to 12 hours I havent seen an example that makes it "work" every sample I see in the internet only spits out 24 hours I know it should be sent to the main.py but I just have no clear clue on how to make it work (I know I may have to do some basic math??)
and finally my issue with my am3231 driver seems to spit out float values that the LCD api doesnt seem to like... so I'm not sure if doing
lcd.putstr(int(sensor.temperature()))
is even remotely correct but seems to be the most simplest thing to do