Skip to content

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

Merged
merged 13 commits into from
Aug 19, 2017

Conversation

mrmcwethy
Copy link
Collaborator

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.

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 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.

"""
def __init__(self, spi, csPin, nDigits=1):
"""
param: spi - an spi busio or spi bitbangio object
Copy link
Member

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:.

# THE SOFTWARE.
"""
`adafruit_max7219.MAX7219` - MAX7219 LED Matrix/Digit Display Driver
============================================================
Copy link
Member

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.

:param ~microcontroller.Pin csPin: board pin to use as chip select signal
"""

cs = digitalio.DigitalInOut(csPin)
Copy link
Member

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.

max7219.Matrix8x8 Example
#########################

.. code-block:: html
Copy link
Member

Choose a reason for hiding this comment

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

.. code-block:: python

max7219.BCDDigits Example
######################

.. code-block:: html
Copy link
Member

Choose a reason for hiding this comment

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

Here too

@tannewt tannewt self-assigned this Aug 19, 2017
@mrmcwethy
Copy link
Collaborator Author

tannewt,
i have made the changes you have pointed out for far. Note that the removal of the original .py file is in a separate pull request. I don't know why. Updated the examples so that they work!

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.

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!

self.clearAll()
self.show()

def setDigit(self, d, v):
Copy link
Member

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.

@mrmcwethy
Copy link
Collaborator Author

Ok, I think i have removed the file, plus updated the method names and examples

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.

Looks good! Thanks!

@tannewt tannewt merged commit 1a003c7 into adafruit:master Aug 19, 2017
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