Skip to content

Update _reset() #13

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

Merged
merged 2 commits into from
Dec 6, 2021
Merged

Update _reset() #13

merged 2 commits into from
Dec 6, 2021

Conversation

caternuson
Copy link
Contributor

Potential fix for #11.

Tried various ways to "reset" the I2C bus, but none were successful. So did something simple instead. This PR is not an elegant solution, but does resolve issue.

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit Feather RP2040 with rp2040
>>> import board
>>> import adafruit_ltr390
>>> ltr = adafruit_ltr390.LTR390(board.I2C())
>>> ltr.light
631
>>> ltr.light
7
>>> 

# The LTR390 software reset is ill behaved and can leave I2C bus in bad state.
# Instead, just manually set register reset values per datasheet.
with self.i2c_device as i2c:
i2c.write(bytes([_CTRL, 0x00]))
Copy link
Member

Choose a reason for hiding this comment

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

can ya make these () tuples instead of [] lists

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yep

@ladyada
Copy link
Member

ladyada commented Dec 6, 2021

🤷‍♂️

@caternuson
Copy link
Contributor Author

🤷

@caternuson caternuson merged commit a4fb22a into adafruit:main Dec 6, 2021
@caternuson caternuson mentioned this pull request Dec 6, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 7, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_ADT7410 to 1.3.0 from 1.2.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_ADT7410#17 from jposada202020/adding_critical_temp_features
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_LTR390 to 1.1.3 from 1.1.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_LTR390#13 from caternuson/iss11
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_BitmapSaver to 1.1.8 from 1.1.7:
  > Merge pull request adafruit/Adafruit_CircuitPython_BitmapSaver#15 from romilly/master
  > update rtd py version

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_Eddystone to 1.0.7 from 1.0.6:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE_Eddystone#15 from tekktrik/docfix/add-blinka-req
  > update rtd py version
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