Coder Social home page Coder Social logo

micropython_ds3231's People

Contributors

balance19 avatar jose1711 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

micropython_ds3231's Issues

I have to ask because I added these lines

under class RTC
m = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]

under def DS3231_ReadTime
month = self.m[self.bcd2bin(buffer[5])]

in if mode ==
if mode == 2:
mod2_string = str(hour) + ":" + str(minute) + ":" + str(second) + " " + weekday + " " + month + "." + str(day) + "," + str(year)
return mod2_string

and finally change 1
t = rtc.DS3231_ReadTime(2)
yet after slapping it into my raspberry pi pico I'm getting the Error: Is the DS3231 not connected display on a 1602 LCD

upload to pypi

could you please upload this to pypi so it can be downloaded directly from Thonny?

A error i can't solve ([Errno 5] EIO)

I connected the DS3231 to my Pico: SDA to pin 16, SCL to pin 17, GND to GND and VCC to VSYS.
I copied the example code in main.py and put the RTC_DS3231.py in a my_lib folder. I didn't change any code.

When i tried to run the code I got the error: ([Errno 5] EIO) and when i tried Settime() in the example code I got:
Traceback (most recent call last):
File "", line 13, in
File "my_lib/RTC_DS3231.py", line 26, in DS3231_SetTime
OSError: [Errno 5] EIO

I tried to run a I2C address scan and got 0x57, but when a changed the address it still got the same error massages.

Does someone know how to solve this problem and make it work like intended?

Using different I2C ports

When I try to use differnt I2C ports on the pico your code give me an error that it can't find the device:
"Error: is the DS3231 not connected or some other problem ([Errno 5] EIO)
Error: is the DS3231 not connected or some other problem ([Errno 5] EIO)"

I have tried changing the port info in your library but it just doesn't take. I can use a simple I2C scanner and see the clock there.

"index out of range" error. Weekday string should be as follows.

When going from Thursday to Friday, program is trying to access in w the eight element. List is only seven elements long.
I replaced :
class RTC:
w = ["SAT","SUN","MON","TUE","WED","THU","FRI"]

with:
class RTC:
w = ["null","SAT","SUN","MON","TUE","WED","THU","FRI"]

Or weekday = self.w[self.bcd2bin(buffer[3])] should be
weekday = self.w[(self.bcd2bin(buffer[3]) - 1)]

Byte for "week" in DS3231_SetTime is for day of the week, not week of the year

I'm not sure if this code is still being maintained, but even if it isn't, this might be useful for other users.
The default NowTime for DS3231_SetTime has x28 for the "week" byte. This byte is actually the day of the week on the DS3231, not the week of the year. It is meant to have values from x01 to x07, with an arbitrary start of the week. If you choose to map the values to the more usual 0-6 system, with Sunday as 0 (like Javascript), then the value should be x04 (Wednesday 14 July 2021), not x28.
Most times it shouldn't matter as the DS3231 ignores the highest 4 bits and unless you are relying on the device for the day of the week, it won't affect the date and time readings.
I suggest that the byte be named "weekday" rather than "week" and the x28 be changed to x04.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.