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

Add basic reset support #50

Closed
wants to merge 2 commits into from
Closed

Conversation

caternuson
Copy link
Contributor

This is for #30.

This may or may not be a good idea. Hoping people in that issue thread can test this against their use case since they have actual fail cases.

I was only able to test happy path:

import time
import board
import digitalio
import adafruit_tca9548a
import adafruit_mma8451
import adafruit_bh1750

rst_pin = digitalio.DigitalInOut(board.D10)

i2c = board.I2C()
tca = adafruit_tca9548a.TCA9548A(i2c, reset=rst_pin)
mma8451 = adafruit_mma8451.MMA8451(tca[1])
bh1750 = adafruit_bh1750.BH1750(tca[4])

# initial readings
print(mma8451.acceleration)
print(bh1750.lux)

# reset
tca.reset()

# second readings
print(mma8451.acceleration)
print(bh1750.lux)

It works, but isn't super interesting since there was no actual failure that was needing to be recovered from.

Adafruit CircuitPython 8.2.7 on 2023-10-19; Adafruit Feather RP2040 with rp2040
>>> import test
(0.0191536, 0.148441, 9.7444)
65.4167
(0.0047884, 0.129287, 9.77313)
65.4167
>>>

@caternuson caternuson mentioned this pull request Nov 10, 2023
@caternuson caternuson requested a review from a team November 16, 2023 16:47
@dhalbert
Copy link
Contributor

I will await some user testing before approving.

Copy link
Contributor

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@caternuson Code looks fine. So I won't merge, awaiting user testing, but merge when you feel confident.

@caternuson
Copy link
Contributor Author

I'm going to close this without merging since no one wanting this commented about it.

@caternuson caternuson closed this Feb 2, 2024
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

Successfully merging this pull request may close these issues.

2 participants