Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the module ds3231 can not communicate with the esp32c3 #7

Open
helloworldleung opened this issue Jan 11, 2025 · 2 comments
Open

the module ds3231 can not communicate with the esp32c3 #7

helloworldleung opened this issue Jan 11, 2025 · 2 comments

Comments

@helloworldleung
Copy link

`from machine import Pin, SoftI2C
from ds3231 import DS3231
import time

i2c = SoftI2C(sda=Pin(4), scl=Pin(5))

ds = DS3231(i2c)
print(ds.datetime())
year = 2020 # Can be yyyy or yy format
month = 10
mday = 3
hour = 13 # 24 hour format only
minute = 55
second = 30 # Optional
weekday = 6 # Optional

datetime = (year, month, mday, hour, minute, second, weekday)
ds.datetime(datetime)
print(ds.datetime())`

result(thonny):
MPY: soft reboot
(2000, 0, 0, 0, 0, 0, 0, 0)
(2000, 0, 0, 0, 0, 0, 0, 0)

board:

thank you for your shareing.the ide do not show any tips,can you give me some help,thank you

@helloworldleung
Copy link
Author

Uploading esp32c3_Pin1.jpg…

@pangopi
Copy link
Owner

pangopi commented Jan 14, 2025

  • Please check your connections between the ESP and DS3231.
  • What version of micropython is installed on the ESP?
  • Can you use the serial monitor to connect to the ESP, start a micropython repl and post the results of running this code?

Please use code blocks to post code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants