-
Notifications
You must be signed in to change notification settings - Fork 6
Updated MAX7219 to be compatible with CircuitPython #1
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for picking this up! I like the split you did. Please fully remove the adafruit_max7219.py
file as a result and I'll keep reviewing the others.
adafruit_max7219/bcddigits.py
Outdated
""" | ||
def __init__(self, spi, csPin, nDigits=1): | ||
""" | ||
param: spi - an spi busio or spi bitbangio object |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the sphinx format for this is :param <type> spi:
such as :param ~busio.SPI spi:
.
adafruit_max7219/max7219.py
Outdated
# THE SOFTWARE. | ||
""" | ||
`adafruit_max7219.MAX7219` - MAX7219 LED Matrix/Digit Display Driver | ||
============================================================ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line should be longer than the line above.
adafruit_max7219/max7219.py
Outdated
:param ~microcontroller.Pin csPin: board pin to use as chip select signal | ||
""" | ||
|
||
cs = digitalio.DigitalInOut(csPin) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lets change the cspin type from microcontroller.Pin to digitalio.DigitalInOut so that other pins that implement the DigitalInOut API work too.
docs/examples.rst
Outdated
max7219.Matrix8x8 Example | ||
######################### | ||
|
||
.. code-block:: html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. code-block:: python
docs/examples.rst
Outdated
max7219.BCDDigits Example | ||
###################### | ||
|
||
.. code-block:: html |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too
tannewt, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One last style thing and then deleting the file. It should be as simple as git rm adafruit_max7219.py
within your master branch. Thanks again!
adafruit_max7219/bcddigits.py
Outdated
self.clearAll() | ||
self.show() | ||
|
||
def setDigit(self, d, v): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change function name style to set_digit. Its a common Python style thing.
Ok, I think i have removed the file, plus updated the method names and examples |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Thanks!
I felt like I needed to separate the base class and derived classes since only one of derived classes would be used at one time. We have the Matrix8x8 class (8x8 LED matrix) and a new BCDDigits class to support 8 digit 7-segment LED displays. I added a new folder and have intended to remove the original .py file. Let me know what else is needed. If approved I plan on updating the bundle to include this new library module.