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

Error message prints wrong number system #128

Open
scirelli opened this issue Jan 30, 2024 · 2 comments
Open

Error message prints wrong number system #128

scirelli opened this issue Jan 30, 2024 · 2 comments

Comments

@scirelli
Copy link
Contributor

Lines 161-164
In the raised error the message adds a 0x to the self.chip_id which is in decimal. In my case the error message read

RuntimeError: Seesaw hardware ID returned 0x67 is not correct! Please check your wiring.

The 67 decimal, which is 0x43 in hex.

@caternuson
Copy link
Contributor

Looks like this happened when changing to F string format done in this PR:
https://github.com/adafruit/Adafruit_CircuitPython_seesaw/pull/118/files

The previous format syntax included {:x} to format the result as hex. A similar format specifier is missing in the current library's f-string syntax.

It's a simple fix though:

>>> foo = 67
>>> f"0x{foo}"
'0x67'
>>> f"0x{foo:x}"
'0x43'
>>> 

@scirelli
Copy link
Contributor Author

I can create a PR to fix it

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