From cf1bec343a45fb2845d1b85f2220677ec439de33 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 10:39:59 -0600 Subject: [PATCH 01/14] renamed simple example; no learn guides found --- examples/{showmatrix.py => max7219_simpletest.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename examples/{showmatrix.py => max7219_simpletest.py} (100%) diff --git a/examples/showmatrix.py b/examples/max7219_simpletest.py similarity index 100% rename from examples/showmatrix.py rename to examples/max7219_simpletest.py From 6e7613837e7494621e2ea541e8908e4281df02ce Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 10:46:43 -0600 Subject: [PATCH 02/14] setup docs folder --- api.rst | 15 ------------ docs/_static/favicon.ico | Bin 0 -> 4414 bytes docs/api.rst | 8 +++++++ conf.py => docs/conf.py | 17 ++++++++++---- docs/examples.rst | 12 ++++++++++ docs/index.rst | 48 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 81 insertions(+), 19 deletions(-) delete mode 100644 api.rst create mode 100644 docs/_static/favicon.ico create mode 100644 docs/api.rst rename conf.py => docs/conf.py (89%) create mode 100644 docs/examples.rst create mode 100644 docs/index.rst diff --git a/api.rst b/api.rst deleted file mode 100644 index daac829..0000000 --- a/api.rst +++ /dev/null @@ -1,15 +0,0 @@ - -Module classes -============== - -Matrices -++++++++ - -.. module:: adafruit_max7219.matrices - :members: - -BCDDigits -+++++++++ - -.. module:: adafruit_max7219.bcddigits.py - :members diff --git a/docs/_static/favicon.ico b/docs/_static/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..5aca98376a1f7e593ebd9cf41a808512c2135635 GIT binary patch literal 4414 zcmd^BX;4#F6n=SG-XmlONeGrD5E6J{RVh+e928U#MG!$jWvO+UsvWh`x&VqGNx*en zx=qox7Dqv{kPwo%fZC$dDwVpRtz{HzTkSs8QhG0)%Y=-3@Kt!4ag|JcIo?$-F|?bXVS9UDUyev>MVZQ(H8K4#;BQW-t2CPorj8^KJrMX}QK zp+e<;4ldpXz~=)2GxNy811&)gt-}Q*yVQpsxr@VMoA##{)$1~=bZ1MmjeFw?uT(`8 z^g=09<=zW%r%buwN%iHtuKSg|+r7HkT0PYN*_u9k1;^Ss-Z!RBfJ?Un4w(awqp2b3 z%+myoFis_lTlCrGx2z$0BQdh+7?!JK#9K9@Z!VrG zNj6gK5r(b4?YDOLw|DPRoN7bdP{(>GEG41YcN~4r_SUHU2hgVtUwZG@s%edC;k7Sn zC)RvEnlq~raE2mY2ko64^m1KQL}3riixh?#J{o)IT+K-RdHae2eRX91-+g!y`8^># z-zI0ir>P%Xon)!@xp-BK2bDYUB9k613NRrY6%lVjbFcQc*pRqiK~8xtkNPLxt}e?&QsTB}^!39t_%Qb)~Ukn0O%iC;zt z<&A-y;3h++)>c1br`5VFM~5(83!HKx$L+my8sW_c#@x*|*vB1yU)_dt3vH;2hqPWx zAl^6@?ipx&U7pf`a*>Yq6C85nb+B=Fnn+(id$W#WB^uHAcZVG`qg;rWB}ubvi(Y>D z$ei>REw$#xp0SHAd^|1hq&9HJ=jKK8^zTH~nk)G?yUcmTh9vUM6Y0LMw4(gYVY$D$ zGl&WY&H<)BbJ&3sYbKjx1j^=3-0Q#f^}(aP1?8^`&FUWMp|rmtpK)bLQ1Zo?^s4jqK=Lfg*9&geMGVQ z#^-*!V`fG@;H&{M9S8%+;|h&Qrxym0Ar>WT4BCVLR8cGXF=JmEYN(sNT(9vl+S|%g z8r7nXQ(95i^`=+XHo|){$vf2$?=`F$^&wFlYXyXg$B{a>$-Fp+V}+D;9k=~Xl~?C4 zAB-;RKXdUzBJE{V&d&%R>aEfFe;vxqI$0@hwVM}gFeQR@j}a>DDxR+n+-*6|_)k%% z*mSpDV|=5I9!&VC&9tD%fcVygWZV!iIo2qFtm#!*(s|@ZT33*Ad;+<|3^+yrp*;oH zBSYLV(H1zTU?2WjrCQoQW)Z>J2a=dTriuvezBmu16`tM2fm7Q@d4^iqII-xFpwHGI zn9CL}QE*1vdj2PX{PIuqOe5dracsciH6OlAZATvE8rj6ykqdIjal2 z0S0S~PwHb-5?OQ-tU-^KTG@XNrEVSvo|HIP?H;7ZhYeZkhSqh-{reE!5di;1zk$#Y zCe7rOnlzFYJ6Z#Hm$GoidKB=2HBCwm`BbZVeZY4ukmG%1uz7p2URs6c9j-Gjj^oQV zsdDb3@k2e`C$1I5ML5U0Qs0C1GAp^?!*`=|Nm(vWz3j*j*8ucum2;r0^-6Aca=Gv) zc%}&;!+_*S2tlnnJnz0EKeRmw-Y!@9ob!XQBwiv}^u9MkaXHvM=!<3YX;+2#5Cj5pp?FEK750S3BgeSDtaE^ zXUM@xoV6yBFKfzvY20V&Lr0yC + + +.. toctree:: + :caption: Other Links + + Download + CircuitPython Reference Documentation + CircuitPython Support Forum + Discord Chat + Adafruit Learning System + Adafruit Blog + Adafruit Store + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` From fca973318ed9beea24210a246edea2414da39ff5 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 10:48:10 -0600 Subject: [PATCH 03/14] updated .travis & .readthedocs yml --- readthedocs.yml => .readthedocs.yml | 0 .travis.yml | 5 +++-- 2 files changed, 3 insertions(+), 2 deletions(-) rename readthedocs.yml => .readthedocs.yml (100%) diff --git a/readthedocs.yml b/.readthedocs.yml similarity index 100% rename from readthedocs.yml rename to .readthedocs.yml diff --git a/.travis.yml b/.travis.yml index 883fd7f..1482448 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,16 +16,17 @@ deploy: provider: releases api_key: $GITHUB_TOKEN file_glob: true - file: bundles/* + file: $TRAVIS_BUILD_DIR/bundles/* skip_cleanup: true overwrite: true on: tags: true install: - - pip install pylint circuitpython-build-tools + - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme script: - pylint adafruit_max7219/*.py - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name,bad-whitespace examples/*.py) - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-max7219 --library_location . + - cd docs && sphinx-build -E -W -b html . _build/html From 42f1198138e81e3a4f19da9ef010588e8e0f265b Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 10:49:28 -0600 Subject: [PATCH 04/14] updated README --- README.rst | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/README.rst b/README.rst index c13d03f..f222c20 100644 --- a/README.rst +++ b/README.rst @@ -87,14 +87,6 @@ adafruit_max7219.BCDDigits Example display.show_str(0,'{:9.2f}'.format(-1234.56)) display.show() -API Reference -============= - -.. toctree:: - :maxdepth: 2 - - api - Contributing ============ @@ -125,3 +117,26 @@ Then run the build: .. code-block:: shell circuitpython-build-bundles --filename_prefix adafruit-circuitpython-max7219 --library_location . + +Sphinx documentation +----------------------- + +Sphinx is used to build the documentation based on rST files and comments in the code. First, +install dependencies (feel free to reuse the virtual environment from above): + +.. code-block:: shell + + python3 -m venv .env + source .env/bin/activate + pip install Sphinx sphinx-rtd-theme + +Now, once you have the virtual environment activated: + +.. code-block:: shell + + cd docs + sphinx-build -E -W -b html . _build/html + +This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to +view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to +locally verify it will pass. From 1636605860f15702af0af2f1d2c2f8f31f78ce23 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 10:52:03 -0600 Subject: [PATCH 05/14] updated api.rst; missing main driver module --- docs/api.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/api.rst b/docs/api.rst index ff89c4d..aa4a929 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,6 +1,9 @@ .. If you created a package, create one automodule per module in the package. +.. module:: adafruit_max7219.max7219 + :members + .. module:: adafruit_max7219.matrices :members: From 3c0a6e161907843d1e747aa60e8a1945faf47b11 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 11:01:43 -0600 Subject: [PATCH 06/14] docstring formatting cleanup --- adafruit_max7219/bcddigits.py | 27 ++++++++++-------- adafruit_max7219/matrices.py | 15 +++++----- adafruit_max7219/max7219.py | 52 +++++++++++++++++++++-------------- 3 files changed, 54 insertions(+), 40 deletions(-) diff --git a/adafruit_max7219/bcddigits.py b/adafruit_max7219/bcddigits.py index 3318c11..45738be 100644 --- a/adafruit_max7219/bcddigits.py +++ b/adafruit_max7219/bcddigits.py @@ -40,14 +40,12 @@ class BCDDigits(max7219.MAX7219): """ Basic support for display on a 7-Segment BCD display controlled by a Max7219 chip using SPI. + + :param object spi: an spi busio or spi bitbangio object + :param ~digitalio.DigitalInOut cs: digital in/out to use as chip select signal + :param int nDigits: number of led 7-segment digits; default 1; max 8 """ def __init__(self, spi, cs, nDigits=1): - """ - :param object spi: an spi busio or spi bitbangio object - :param ~digitalio.DigitalInOut cs: digital in/out to use as chip select - signal - :param int nDigits: number of led 7-segment digits; default 1; max 8 - """ self._ndigits = nDigits super().__init__(self._ndigits, 8, spi, cs) @@ -66,7 +64,8 @@ def init_display(self): def set_digit(self, dpos, value): """ - set one digit in the display + Set one digit in the display. + :param int dpos: the digit position; zero-based :param int value: integer ranging from 0->15 """ @@ -78,7 +77,8 @@ def set_digit(self, dpos, value): def set_digits(self, start, values): """ - set the display from a list + Set the display from a list. + :param int s: digit to start display zero-based :param list ds: list of integer values ranging from 0->15 """ @@ -89,7 +89,8 @@ def set_digits(self, start, values): def show_dot(self, dpos, bit_value=None): """ - set the decimal point for a digit + Set the decimal point for a digit. + :param int dpos: the digit to set the decimal point zero-based :param int value: value > zero lights the decimal point, else unlights the point """ @@ -99,7 +100,7 @@ def show_dot(self, dpos, bit_value=None): def clear_all(self): """ - clear all digits and decimal points + Clear all digits and decimal points. """ self.fill(1) for i in range(self._ndigits): @@ -107,7 +108,8 @@ def clear_all(self): def show_str(self, start, strg): """ - displays a numeric str in the display. shows digits 0-9, -, and . + Displays a numeric str in the display. Shows digits ``0-9``, ``-``, and ``.``. + :param int start: start position to show the numeric string :param string str: the numeric string """ @@ -127,7 +129,8 @@ def show_str(self, start, strg): def show_help(self, start): """ - display the word HELP in the display + Display the word HELP in the display. + :param int start: start position to show HELP """ digits = [12, 11, 13, 14] diff --git a/adafruit_max7219/matrices.py b/adafruit_max7219/matrices.py index b22700b..1f53ae4 100644 --- a/adafruit_max7219/matrices.py +++ b/adafruit_max7219/matrices.py @@ -37,12 +37,13 @@ _DISPLAYTEST = const(15) class Matrix8x8(max7219.MAX7219): - """Driver for a 8x8 LED matrix based on the MAX7219 chip""" + """ + Driver for a 8x8 LED matrix based on the MAX7219 chip. + + :param object spi: an spi busio or spi bitbangio object + :param ~digitalio.DigitalInOut cs: digital in/out to use as chip select signal + """ def __init__(self, spi, cs): - """ - :param object spi: an spi busio or spi bitbangio object - :param ~digitalio.DigitalInOut cs: digital in/out to use as chip select signal - """ super().__init__(8, 8, spi, cs) def init_display(self): @@ -59,7 +60,7 @@ def init_display(self): def text(self, strg, xpos, ypos, bit_value=1): """ - draw text in the 8x8 matrix. + Draw text in the 8x8 matrix. :param int xpos: x position of LED in matrix :param int ypos: y position of LED in matrix @@ -70,6 +71,6 @@ def text(self, strg, xpos, ypos, bit_value=1): def clear_all(self): """ - unlights all matrix leds + Clears all matrix leds. """ self.fill(0) diff --git a/adafruit_max7219/max7219.py b/adafruit_max7219/max7219.py index a95ad5f..e29f551 100644 --- a/adafruit_max7219/max7219.py +++ b/adafruit_max7219/max7219.py @@ -26,24 +26,30 @@ This library supports the use of the MAX7219-based display in CircuitPython, either an 8x8 matrix or a 8 digit 7-segment numeric display. -see also -======== +See Also +========= * matrices.Maxtrix8x8 is a class support an 8x8 led matrix display * bcddigits.BCDDigits is a class that support the 8 digit 7-segment display Beware that most CircuitPython compatible hardware are 3.3v logic level! Make sure that the input pin is 5v tolerant. + * Author(s): Michael McWethy Implementation Notes -------------------- **Hardware:** + * Adafruit `MAX7219CNG LED Matrix/Digit Display Driver - -MAX7219 `_ (Product ID: 453) + MAX7219 `_ (Product ID: 453) + **Software and Dependencies:** -* Adafruit CircuitPython firmware (1.0.0+) for the ESP8622 and M0-based boards: + +* Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: https://github.com/adafruit/circuitpython/releases + * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice + **Notes:** #. Datasheet: https://cdn-shop.adafruit.com/datasheets/MAX7219.pdf """ @@ -63,18 +69,19 @@ class MAX7219: - """ MAX2719 - driver for displays based on max719 chip_select""" + """ + MAX2719 - driver for displays based on max719 chip_select + + :param int width: the number of pixels wide + :param int height: the number of pixels high + :param object spi: an spi busio or spi bitbangio object + :param ~digitalio.DigitalInOut chip_select: digital in/out to use as chip select signal + :param baudrate: for SPIDevice baudrate (default 8000000) + :param polarity: for SPIDevice polarity (default 0) + :param phase: for SPIDevice phase (default 0) + """ def __init__(self, width, height, spi, cs, *, baudrate=8000000, polarity=0, phase=0): - """ - :param int width: the number of pixels wide - :param int height: the number of pixels high - :param object spi: an spi busio or spi bitbangio object - :param ~digitalio.DigitalInOut chip_select: digital in/out to use as chip select signal - :param baudrate: for SPIDevice baudrate (default 8000000) - :param polarity: for SPIDevice polarity (default 0) - :param phase: for SPIDevice phase (default 0) - """ self._chip_select = cs self._chip_select.direction = digitalio.Direction.OUTPUT @@ -91,12 +98,13 @@ def __init__(self, width, height, spi, cs, *, self.init_display() def init_display(self): - """must be implement by derived class""" + """Must be implemented by derived class (``matrices``, ``bcddigits``)""" pass def brightness(self, value): """ - control the brightness of the display + Controls the brightness of the display. + :param int value: 0->15 dimmest to brightest """ if not 0 <= value <= 15: @@ -105,21 +113,23 @@ def brightness(self, value): def show(self): """ - update the display with recent changes in buffer + Updates the display with recent changes in buffer. """ for ypos in range(8): self.write_cmd(_DIGIT0 + ypos, self._buffer[ypos]) def fill(self, bit_value): """ - set all buffer bits to a col + Sets all buffer bits to a col + :param bit_value: int value > 0 set the buffer bit, else clears the buffer bit """ self.framebuf.fill(bit_value) def pixel(self, xpos, ypos, bit_value=None): """ - set one buffer bit + Set one buffer bit + :param xpos: x position to set bit :param ypos: y position to set bit :param bit_value: int value > 0 sets the buffer bit, else clears the buffer bit @@ -128,11 +138,11 @@ def pixel(self, xpos, ypos, bit_value=None): self.framebuf.pixel(xpos, ypos, bit_value) def scroll(self, delta_x, delta_y): - """scolls the display using delta_x,delta_y""" + """Scolls the display using delta_x,delta_y.""" self.framebuf.scroll(delta_x, delta_y) def write_cmd(self, cmd, data): - """writes a command to spi device""" + """Writes a command to spi device.""" #print('cmd {} data {}'.format(cmd,data)) self._chip_select.value = False with self._spi_device as my_spi_device: From beec536106e9e1cece2906dc26deed52c681dd54 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 11:11:58 -0600 Subject: [PATCH 07/14] pylint fix; whitespace strikes again! --- adafruit_max7219/max7219.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_max7219/max7219.py b/adafruit_max7219/max7219.py index e29f551..f11f4e5 100644 --- a/adafruit_max7219/max7219.py +++ b/adafruit_max7219/max7219.py @@ -42,7 +42,7 @@ * Adafruit `MAX7219CNG LED Matrix/Digit Display Driver - MAX7219 `_ (Product ID: 453) - + **Software and Dependencies:** * Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: From 9d60dda365b86e6094468c497af04185a98e3446 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 11:13:42 -0600 Subject: [PATCH 08/14] sphinx fix; used 'module' vs 'automodule' --- docs/api.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index aa4a929..8e9378b 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,11 +1,11 @@ .. If you created a package, create one automodule per module in the package. -.. module:: adafruit_max7219.max7219 +.. automodule:: adafruit_max7219.max7219 :members -.. module:: adafruit_max7219.matrices +.. automodule:: adafruit_max7219.matrices :members: -.. module:: adafruit_max7219.bcddigits +.. automodule:: adafruit_max7219.bcddigits :members From f029f95f66e6110d1a7d9f0ad972547378bdf628 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 11:20:45 -0600 Subject: [PATCH 09/14] sphinx fis; api.rst missing syntax --- docs/api.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 8e9378b..90c64dc 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2,10 +2,10 @@ .. If you created a package, create one automodule per module in the package. .. automodule:: adafruit_max7219.max7219 - :members + :members: .. automodule:: adafruit_max7219.matrices :members: .. automodule:: adafruit_max7219.bcddigits - :members + :members: From ada5c7904b5464070bebeeda45468095e68c3325 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 11:23:23 -0600 Subject: [PATCH 10/14] sphinx fix; missed autodoc_mock for framebuf --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index ef1d55d..b1c64a2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -18,7 +18,7 @@ # Uncomment the below if you use native CircuitPython modules such as # digitalio, micropython and busio. List the modules you use. Without it, the # autodoc module docs will fail to generate with a warning. -autodoc_mock_imports = ["digitalio", "adafruit_bus_device", "micropython"] +autodoc_mock_imports = ["digitalio", "adafruit_bus_device", "micropython", "framebuf"] intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)} From 028aae6c7bfef9314ce66c2b25a3baf6f686461a Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 11:26:22 -0600 Subject: [PATCH 11/14] sphinx fix; coffee is not working this AM --- adafruit_max7219/max7219.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_max7219/max7219.py b/adafruit_max7219/max7219.py index f11f4e5..2b02972 100644 --- a/adafruit_max7219/max7219.py +++ b/adafruit_max7219/max7219.py @@ -46,7 +46,7 @@ **Software and Dependencies:** * Adafruit CircuitPython firmware for the ESP8622 and M0-based boards: -https://github.com/adafruit/circuitpython/releases + https://github.com/adafruit/circuitpython/releases * Adafruit's Bus Device library: https://github.com/adafruit/Adafruit_CircuitPython_BusDevice From 64c5c4d55ce7c76cf86510fbbe302bd77eb114c9 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 11:36:30 -0600 Subject: [PATCH 12/14] sphinx fix; insconsistent title due to errant '****' rst section --- README.rst | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.rst b/README.rst index f222c20..6849cd1 100644 --- a/README.rst +++ b/README.rst @@ -27,9 +27,6 @@ This is easily achieved by downloading Usage Example ============= -Examples -******** - adafruit_max7219.Matrix8x8 Example ---------------------------------- From 7e33c16fd6995e4008f4c7565299a63d218987b6 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Fri, 2 Mar 2018 11:42:46 -0600 Subject: [PATCH 13/14] sphinx fix --- adafruit_max7219/bcddigits.py | 2 +- adafruit_max7219/matrices.py | 2 +- adafruit_max7219/max7219.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_max7219/bcddigits.py b/adafruit_max7219/bcddigits.py index 45738be..d1439b3 100644 --- a/adafruit_max7219/bcddigits.py +++ b/adafruit_max7219/bcddigits.py @@ -22,7 +22,7 @@ # """ -:mod:`adafruit_max7219.bcddigits.BCDDigits` +`adafruit_max7219.bcddigits.BCDDigits` ==================================================== """ from adafruit_max7219 import max7219 diff --git a/adafruit_max7219/matrices.py b/adafruit_max7219/matrices.py index 1f53ae4..6724cc2 100644 --- a/adafruit_max7219/matrices.py +++ b/adafruit_max7219/matrices.py @@ -22,7 +22,7 @@ # """ -:mod:`adafruit_max7219.matrices.Matrix8x8` +`adafruit_max7219.matrices.Matrix8x8` ==================================================== """ from adafruit_max7219 import max7219 diff --git a/adafruit_max7219/max7219.py b/adafruit_max7219/max7219.py index 2b02972..118bb2c 100644 --- a/adafruit_max7219/max7219.py +++ b/adafruit_max7219/max7219.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_max7219.MAX7219` - MAX7219 LED Matrix/Digit Display Driver +`adafruit_max7219.max7219` - MAX7219 LED Matrix/Digit Display Driver ======================================================================== CircuitPython library to support MAX7219 LED Matrix/Digit Display Driver. This library supports the use of the MAX7219-based display in CircuitPython, From 29094285c2fb8dd00066c0fa6849c37b1cd86779 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 4 Mar 2018 20:29:31 -0600 Subject: [PATCH 14/14] updated PR requested changes --- adafruit_max7219/bcddigits.py | 6 +++--- adafruit_max7219/max7219.py | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/adafruit_max7219/bcddigits.py b/adafruit_max7219/bcddigits.py index d1439b3..63bc98e 100644 --- a/adafruit_max7219/bcddigits.py +++ b/adafruit_max7219/bcddigits.py @@ -64,7 +64,7 @@ def init_display(self): def set_digit(self, dpos, value): """ - Set one digit in the display. + Display one digit. :param int dpos: the digit position; zero-based :param int value: integer ranging from 0->15 @@ -77,7 +77,7 @@ def set_digit(self, dpos, value): def set_digits(self, start, values): """ - Set the display from a list. + Display digits from a list. :param int s: digit to start display zero-based :param list ds: list of integer values ranging from 0->15 @@ -89,7 +89,7 @@ def set_digits(self, start, values): def show_dot(self, dpos, bit_value=None): """ - Set the decimal point for a digit. + The decimal point for a digit. :param int dpos: the digit to set the decimal point zero-based :param int value: value > zero lights the decimal point, else unlights the point diff --git a/adafruit_max7219/max7219.py b/adafruit_max7219/max7219.py index 118bb2c..3a1ebcb 100644 --- a/adafruit_max7219/max7219.py +++ b/adafruit_max7219/max7219.py @@ -113,16 +113,16 @@ def brightness(self, value): def show(self): """ - Updates the display with recent changes in buffer. + Updates the display. """ for ypos in range(8): self.write_cmd(_DIGIT0 + ypos, self._buffer[ypos]) def fill(self, bit_value): """ - Sets all buffer bits to a col + Fill the display buffer. - :param bit_value: int value > 0 set the buffer bit, else clears the buffer bit + :param int bit_value: value > 0 set the buffer bit, else clears the buffer bit """ self.framebuf.fill(bit_value) @@ -132,13 +132,13 @@ def pixel(self, xpos, ypos, bit_value=None): :param xpos: x position to set bit :param ypos: y position to set bit - :param bit_value: int value > 0 sets the buffer bit, else clears the buffer bit + :param int bit_value: value > 0 sets the buffer bit, else clears the buffer bit """ bit_value = 0x01 if bit_value else 0x00 self.framebuf.pixel(xpos, ypos, bit_value) def scroll(self, delta_x, delta_y): - """Scolls the display using delta_x,delta_y.""" + """Srcolls the display using delta_x,delta_y.""" self.framebuf.scroll(delta_x, delta_y) def write_cmd(self, cmd, data):