Skip to content

Add adafruit_bus_device dependency #50

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 7 commits into from
Apr 4, 2022
Merged

Add adafruit_bus_device dependency #50

merged 7 commits into from
Apr 4, 2022

Conversation

tekktrik
Copy link
Member

I debated trying to incorporate adafruit_register as well in a few different ways, but none of the exist classes do exactly what the library needs it seems, so I left that aspect as is.

Also adds some minor documentations additions.

Resolves #49

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

Looks good to me. Tested successfully with Feather RP2040 and 15x7 Charliewing. using some of the scripts in examples directory of this repo. Thank you @tekktrik

@FoamyGuy
Copy link
Contributor

Ah, didn't see that it has merge conflicts until after I submitted review. I see how extensive those are, perhaps I can add a commit to resolve them.

@tekktrik
Copy link
Member Author

No worries, I merged the other so I should have checked this! I just merged main into the PR branch, wanna test it again to be safe?

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

I took a look at the conflicts but I don't quite understand enough of the communication occurring to resolve them properly. I took a try at it but the resulting library raises an error when I attempt to test it.

AttributeError: 'CharlieWing' object has no attribute 'i2c'

I think I did not correctly resolve the differences in this section:
image

@tekktrik or @PaintYourDragon can one of you take a look and see if you're able to tell how this section needs to be to resolve conflicts?

"""

width = 16
height = 9

def __init__(self, i2c, address=0x74):
self.i2c = i2c
self.address = address
self.i2c_device = I2CDevice(i2c, address)
self._frame = None
self._init()

def _i2c_read_reg(self, reg, result):
Copy link
Contributor

Choose a reason for hiding this comment

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

This function got changed by another recent PR and the changes will get need to get conflicts resolved with this one before it can get merged.

Copy link
Member Author

Choose a reason for hiding this comment

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

@FoamyGuy I should have just resolved the conflicts in the latest commit! For this, it's sufficient to just store self.i2c_device and use that in the other pertinent functions.

@tekktrik
Copy link
Member Author

Aaaaaand there are some other problems with it haha, let me take a look

@FoamyGuy
Copy link
Contributor

Current version raises this error:

code.py output:
Traceback (most recent call last):
  File "code.py", line 24, in <module>
  File "/lib/adafruit_is31fl3731/__init__.py", line 100, in __init__
  File "/lib/adafruit_is31fl3731/__init__.py", line 142, in _init
AttributeError: 'CharlieWing' object has no attribute '_i2c_write_block'

Thanks for looking into it. Feel free to ping me once it's ready for re-test.

@tekktrik
Copy link
Member Author

So turns out I overwrote an update @PaintYourDragon made to use a function that DIDN'T utilize a register that I didn't realized was used in their update, so I added that back in. Shooooouuuld be good now, thanks for your patience!

@tekktrik tekktrik requested a review from FoamyGuy March 28, 2022 15:24
@FoamyGuy
Copy link
Contributor

@tekktrik I think there is still some kind of trouble unfortunately. With the latest version the simpletest script results in a very brief "static looking scramble" on the LEDs and then all shut off.

With current released library:
image

With latest version from PR:

led_matrix.mp4

When the LEDs change in the video is when I pasted the current version of library from this PR and it noticed the file change to trigger the reboot / re-run.

I'm guessing this is something related to timing or else something very foundational to the communication. I am getting different results when it runs if I try multiple times. The first few times the entire matrix showed a "static looking scramble" for a split second and then turned off. A few times it did what is depicted int he video (only a few corner LEDs turn on instead of the whole outter row). Also a few times I saw it turn on most of the outter row except for these two LEDs and then switch so that these two turned on and the rest turned off.

@tekktrik
Copy link
Member Author

Got it, I'll look deeper at the merge and see if I borked anything. Thanks for following up!

@tekktrik
Copy link
Member Author

@FoamyGuy yup I borked it. Good suggestion about communication - it was accidentally writing an extra \x00 when using _i2c_write_block().

Copy link
Contributor

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

Tested latest version successfully with example scripts from the repo and Feather RP2040 + 15x7 Charliewing

Thanks @tekktrik

@FoamyGuy FoamyGuy merged commit 1f8f520 into adafruit:main Apr 4, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Apr 5, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_74HC595 to 1.3.5 from 1.3.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_AMG88xx to 1.2.13 from 1.2.12:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_BME280 to 2.6.11 from 2.6.10:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_CircuitPlayground to 5.0.5 from 5.0.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_CLUE to 3.0.5 from 3.0.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_DisplayIO_SH1107 to 1.5.3 from 1.5.2:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_ESP_ATcontrol to 0.6.4 from 0.6.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_FocalTouch to 1.4.1 from 1.4.0:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_IRRemote to 4.1.4 from 4.1.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731 to 3.3.0 from 3.2.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_IS31FL3731#50 from tekktrik/dev/use-bus-device
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_LSM6DS to 4.4.3 from 4.4.2:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_MAX7219 to 1.5.3 from 1.5.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_MAX7219#42 from tekktrik/doc/update-example-pins

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9600 to 1.2.4 from 1.2.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_MCP9808 to 3.3.12 from 3.3.11:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_MLX90393 to 2.0.10 from 2.0.9:
  > Merge pull request adafruit/Adafruit_CircuitPython_MLX90393#31 from tekktrik/doc/add-typing
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_SCD4X to 1.3.1 from 1.3.0:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_TLA202X to 1.0.6 from 1.0.5:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_TSC2007 to 1.0.1 from 1.0.0:
  > "Reformatted per new black version"

Updating https://github.com/adafruit/Adafruit_CircuitPython_TT21100 to 0.8.1 from 0.8.0:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Corrected pylint version

Updating https://github.com/adafruit/Adafruit_CircuitPython_VC0706 to 5.0.0 from 4.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_VC0706#23 from FoamyGuy/doc_strings
  > Merge pull request adafruit/Adafruit_CircuitPython_VC0706#22 from Neradoc/fix-documentation

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.6.1 from 3.6.0:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L1X to 1.1.0 from 1.0.2:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L1X#3 from wrdaigle/main
  > Fixed readthedocs build

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL6180X to 1.4.3 from 1.4.2:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.2.4 from 8.2.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE_BroadcastNet to 0.12.2 from 0.12.1:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Colorsys to 2.0.5 from 2.0.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Dash_Dis to 1.1.4 from 1.1.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_datetime to 1.1.7 from 1.1.6:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Post-patch cleanup pt2
  > Post-patch cleanup
  > Consolidate Documentation sections of README
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_Ducky to 1.0.4 from 1.0.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_LED_Animation to 2.5.15 from 2.5.14:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_MacroPad to 2.1.1 from 2.1.0:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_miniesptool to 0.2.12 from 0.2.11:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_miniQR to 1.3.9 from 1.3.8:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README

Updating https://github.com/adafruit/Adafruit_CircuitPython_PIOASM to 0.6.3 from 0.6.2:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_PortalBase to 1.11.5 from 1.11.4:
  > Merge pull request adafruit/Adafruit_CircuitPython_PortalBase#69 from tekktrik/dev/fix-doc-building
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_PyBadger to 3.6.4 from 3.6.3:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.11.2 from 1.11.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#107 from tekktrik/doc/rerun-black
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Slideshow to 1.7.5 from 1.7.4:
  > "Reformatted per new black version"
  > Update Black to latest.

Updating https://github.com/adafruit/Adafruit_CircuitPython_Waveform to 1.3.11 from 1.3.10:
  > "Reformatted per new black version"
  > Update Black to latest.
  > Fixed readthedocs build
  > Consolidate Documentation sections of README
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bus Device & Register dependancy
2 participants