adafruit / Adafruit_CircuitPython_IS31FL3731

CircuitPython driver for the IS31FL3731 charlieplex IC
MIT License
22 stars 25 forks source link

Add Rotation and Typing #54

Closed DJDevon3 closed 4 months ago

DJDevon3 commented 5 months ago

Added new feature: ability to rotate display 0,90,180,270.

This will be particularly useful to arrange multiple charlieplexed matrixes together in any orientation for chaining. I don't think chaining multiple into 1 matrix is currently supported but it's a step in the right direction.

Added 16x9 charlieplex example that includes the new rotation feature.

"attempted" to add typing annotations... expect some to be wrong and that's ok, an attempt was made. i did not attempt to type every file. want to be sure i can do at least 1 correctly first then will do the other examples.

Rotation = 0 (hard to photograph because it's a scrolling marquee) IMG_1487

Rotation = 90 IMG_1488

DJDevon3 commented 5 months ago

Oof, that'll keep me busy. I didn't try to type init on purpose because I thought you couldn't type init's.

Thank you for the review and the hints. I'm on it.

In the mean time here's a nice demo of the rotation.

https://github.com/adafruit/Adafruit_CircuitPython_IS31FL3731/assets/49322231/69b7dcdb-1176-48a0-8fe0-b3f26f868845

DJDevon3 commented 5 months ago

Note to self don't put pound symbols in commit titles. github formatted it to point at adafruit issue number 2. i don't know how to fix that.

oh dear lord the amount of errors... pylint hates me.

DJDevon3 commented 5 months ago

🏳️ I Surrender. Pylint has defeated me.

I defined ReadableBuffer in both typing and circuitpython_typing. Pylint won't recognize either of them.

DJDevon3 commented 5 months ago

I can only conclude that ReadableBuffer does not exist in circuitpython_typing.

DJDevon3 commented 5 months ago

There are now 4 ReadableBuffer errors instead of 1... So it was correctly setting 3 of them previously.

DJDevon3 commented 5 months ago

I set it back and now there's only 1 ReadableBuffer error again...

DJDevon3 commented 5 months ago

So I replaced the error on line 119 def _i2c_read_reg(self, reg: Optional[int] = None, result: Optional[ReadableBuffer] = None): with def _i2c_read_reg(self, reg: Optional[int] = None, result: Optional[int] = None): and that passes but now errors on line 128 which is the next Optional[ReadableBuffer] use.

DJDevon3 commented 5 months ago

Nope, I'm not allowed to use ReadableBuffer or WriteableBuffer in any fashion.

DJDevon3 commented 5 months ago

Capture

DJDevon3 commented 4 months ago

@FoamyGuy God bless you. Thank you. 🙏 Yes that was a struggle. I don't want to see pylint again until next year.