Skip to content

Add support for multiple TCAs #10

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
Jul 5, 2019
Merged

Add support for multiple TCAs #10

merged 2 commits into from
Jul 5, 2019

Conversation

caternuson
Copy link
Contributor

For #9 . Simple one liner to turn off all outputs when done with I2C transactions.

Adafruit CircuitPython 4.0.1 on 2019-05-22; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board, adafruit_tca9548A, adafruit_drv2605
>>> tca1 = adafruit_tca9548A.TCA9548A(board.I2C())
>>> tca2 = adafruit_tca9548A.TCA9548A(board.I2C(), address=0x71)
>>> tca3 = adafruit_tca9548A.TCA9548A(board.I2C(), address=0x72)
>>> drv1 = adafruit_drv2605.DRV2605(tca1[0])
>>> drv2 = adafruit_drv2605.DRV2605(tca2[0])
>>> drv3 = adafruit_drv2605.DRV2605(tca3[0])
>>> drv4 = adafruit_drv2605.DRV2605(tca3[3])
>>> drv1.play()
>>> drv2.play()
>>> drv3.play()
>>> drv4.play()
>>>

tca_test

@caternuson caternuson requested a review from a team July 2, 2019 22:54
@@ -67,6 +67,7 @@ def try_lock(self):

def unlock(self):
"""Pass thru for unlock."""
self.tca.i2c.writeto(self.tca.address, bytes([0]))
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.tca.i2c.writeto(self.tca.address, bytes([0]))
self.tca.i2c.writeto(self.tca.address, b"\x0")

Using a byte literal will avoid creating a list to throw away.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Neat! done.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thank you!

@tannewt tannewt merged commit 8d211f4 into adafruit:master Jul 5, 2019
@caternuson caternuson mentioned this pull request Jul 25, 2019
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Aug 7, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_HX8357 to 1.1.0 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_HX8357#4 from makermelissa/master

Updating https://github.com/adafruit/Adafruit_CircuitPython_TCA9548A to 0.2.1 from 0.2.0:
  > Merge pull request adafruit/Adafruit_CircuitPython_TCA9548A#12 from caternuson/iss11
  > Merge pull request adafruit/Adafruit_CircuitPython_TCA9548A#10 from caternuson/iss9

Updating https://github.com/adafruit/Adafruit_CircuitPython_Display_Shapes to 1.1.2 from 1.0.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#6 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#5 from makermelissa/master
  > Merge pull request adafruit/Adafruit_CircuitPython_Display_Shapes#4 from makermelissa/master
  > fixed typo in rtd link
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