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

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

Open
JoelGodin opened this issue Aug 26, 2022 · 1 comment
Open

Comments

@JoelGodin
Copy link

JoelGodin commented Aug 26, 2022

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)]

@JoelGodin
Copy link
Author

Used 2nd solution and requested Pull.

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

1 participant