From c706cfed842f0c8ea6b48cb6eb1002429d03989d Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 12:53:26 -0600 Subject: [PATCH 01/50] renamed some examples --- .../{hello_CircuitPython_I2C.py => charlcd_I2C_simpletest.py} | 0 .../{hello_CircuitPython_SPI.py => charlcd_SPI_simpletest.py} | 0 examples/{hello_CircuitPython.py => charlcd_mono_simpletest.py} | 0 .../{rgb_hello_CircuitPython.py => charlcd_rgb_simpletest.py} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename examples/{hello_CircuitPython_I2C.py => charlcd_I2C_simpletest.py} (100%) rename examples/{hello_CircuitPython_SPI.py => charlcd_SPI_simpletest.py} (100%) rename examples/{hello_CircuitPython.py => charlcd_mono_simpletest.py} (100%) rename examples/{rgb_hello_CircuitPython.py => charlcd_rgb_simpletest.py} (100%) diff --git a/examples/hello_CircuitPython_I2C.py b/examples/charlcd_I2C_simpletest.py similarity index 100% rename from examples/hello_CircuitPython_I2C.py rename to examples/charlcd_I2C_simpletest.py diff --git a/examples/hello_CircuitPython_SPI.py b/examples/charlcd_SPI_simpletest.py similarity index 100% rename from examples/hello_CircuitPython_SPI.py rename to examples/charlcd_SPI_simpletest.py diff --git a/examples/hello_CircuitPython.py b/examples/charlcd_mono_simpletest.py similarity index 100% rename from examples/hello_CircuitPython.py rename to examples/charlcd_mono_simpletest.py diff --git a/examples/rgb_hello_CircuitPython.py b/examples/charlcd_rgb_simpletest.py similarity index 100% rename from examples/rgb_hello_CircuitPython.py rename to examples/charlcd_rgb_simpletest.py From a1d6d327445092e87aa654f0109e23f0136317c3 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 13:04:54 -0600 Subject: [PATCH 02/50] setup docs folder --- docs/_static/favicon.ico | Bin 0 -> 4414 bytes api.rst => docs/api.rst | 0 conf.py => docs/conf.py | 20 ++++++++++++++--- docs/examples.rst | 20 +++++++++++++++++ docs/index.rst | 47 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 84 insertions(+), 3 deletions(-) create mode 100644 docs/_static/favicon.ico rename api.rst => docs/api.rst (100%) rename conf.py => docs/conf.py (85%) create mode 100644 docs/examples.rst create mode 100644 docs/index.rst 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 cdaf85eec81e0bb66b12de0cee97084755eb9554 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 13:06:17 -0600 Subject: [PATCH 03/50] 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 a18f1d6..d0c4a0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,15 +16,16 @@ deploy: provider: releases api_key: $GITHUB_TOKEN file_glob: true - file: bundles/* + file: $TRAVIS_BUILD_DIR/bundles/* skip_cleanup: true on: tags: true install: - - pip install pylint circuitpython-build-tools + - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme script: - pylint adafruit_character_lcd/*.py - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-charlcd --library_location . + - cd docs && sphinx-build -E -W -b html . _build/html From 87234e0701f316ea8062dfae55ca3631f3f7cd70 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 13:13:08 -0600 Subject: [PATCH 04/50] updated README --- README.md => README.rst | 81 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 10 deletions(-) rename README.md => README.rst (50%) diff --git a/README.md b/README.rst similarity index 50% rename from README.md rename to README.rst index 795ce11..cbc7ce3 100644 --- a/README.md +++ b/README.rst @@ -2,10 +2,18 @@ Introduction ============ +.. image:: https://readthedocs.org/projects/adafruit-circuitpython-charlcd/badge/?version=latest + :target: https://circuitpython.readthedocs.io/projects/charlcd/en/latest/ + :alt: Documentation Status + +.. image :: https://img.shields.io/discord/327254708534116352.svg + :target: https://discord.gg/nBQh6qu + :alt: Discord + This library is compatible with standard Character LCDs such as: -* [Adafruit Standard LCD 16x2](https://www.adafruit.com/product/181) -* [Adafruit RGB backlight negative LCD 16x2](https://www.adafruit.com/product/399) -* [Adafruit RGB backlight negative LCD 20x4](https://www.adafruit.com/product/498) +* `Adafruit Standard LCD 16x2 `_ +* `Adafruit RGB backlight negative LCD 16x2 `_ +* `Adafruit RGB backlight negative LCD 20x4 `_ Compatible with CircuitPython Versions: 2.x @@ -13,23 +21,30 @@ Dependencies ============= This driver depends on: -* [Adafruit CircuitPython](https://github.com/adafruit/circuitpython "CircuitPython") +* `Adafruit CircuitPython `_ + +I2C & SPI displays also depend on: +* `Bus Device `_ Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading -[the Adafruit library and driver bundle.](https://github.com/adafruit/Adafruit_CircuitPython_Bundle) +`the Adafruit library and driver bundle `_. Usage Example ============= The ``Character_LCD`` class interfaces a predefined Character LCD display with CircuitPython. +.. code-block:: python + import adafruit_character_lcd You must define the data pins (``RS``, ``EN``, ``D4``, ``D5``, ``D6``, ``D7``) in your code before using the ``Character_LCD`` class. If you want to have on/off ``backlight`` functionality, you can also define your backlight as ``lcd_backlight``. Otherwise, the backlight will always remain on. An example of this is below +.. code-block:: python + lcd_rs = digitalio.DigitalInOut(D7) lcd_en = digitalio.DigitalInOut(D8) lcd_d7 = digitalio.DigitalInOut(D12) @@ -40,16 +55,22 @@ If you want to have on/off ``backlight`` functionality, you can also define your You must also define the size of the CharLCD by specifying its ``lcd_columns`` and ``lcd_rows``: +.. code-block:: python + lcd_columns = 16 lcd_rows = 2 After you have set up your LCD, we can make the device by calling it +.. code-block:: python + lcd = adafruit_character_lcd.Character_LCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight) To verify that your pins are correct, print a hello message to the CharLCD: +.. code-block:: python + lcd.message('hello\ncircuitpython') @@ -73,9 +94,49 @@ To install: #. Download and unzip the `latest release zip `_. #. Copy the unzipped ``adafruit_character_lcd`` to the ``lib`` directory on the ``CIRCUITPY`` or ``MICROPYTHON`` drive. -API -=== -.. toctree:: - :maxdepth: 3 +Building locally +================ + +To build this library locally you'll need to install the +`circuitpython-build-tools `_ package. + +.. code-block:: shell + + python3 -m venv .env + source .env/bin/activate + pip install circuitpython-build-tools + +Once installed, make sure you are in the virtual environment: + +.. code-block:: shell + + source .env/bin/activate + +Then run the build: + +.. code-block:: shell + + circuitpython-build-bundles --filename_prefix adafruit-circuitpython-charlcd --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 - api +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. \ No newline at end of file From bcd94837416eb04a25cf85c301dc607612c47248 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 13:23:57 -0600 Subject: [PATCH 05/50] sphinx fix --- adafruit_character_lcd/character_lcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index b516c49..d094ff1 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -123,7 +123,7 @@ class Character_LCD(object): :param cols: The columns on the charLCD :param lines: The lines on the charLCD :param ~digitalio.DigitalInOut backlight: The backlight pin, usually - the last pin. Check with your datasheet + the last pin. Check with your datasheet """ #pylint: disable-msg=too-many-arguments def __init__(self, rs, en, d4, d5, d6, d7, cols, lines, From 1085e3f73e474acfba94cccfee6edcf762bef441 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:01:48 -0600 Subject: [PATCH 06/50] sphinx fixes; docstring indentation --- adafruit_character_lcd/character_lcd.py | 66 +++++++++++++++---------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index d094ff1..dd90a63 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -113,17 +113,18 @@ def _set_bit(byte_value, position, val): #pylint: disable-msg=too-many-instance-attributes class Character_LCD(object): - """ Interfaces with a character LCD - :param ~digitalio.DigitalInOut rs: The reset data line - :param ~digitalio.DigitalInOut en: The enable data line - :param ~digitalio.DigitalInOut d4: The data line 4 - :param ~digitalio.DigitalInOut d5: The data line 5 - :param ~digitalio.DigitalInOut d6: The data line 6 - :param ~digitalio.DigitalInOut d7: The data line 7 - :param cols: The columns on the charLCD - :param lines: The lines on the charLCD - :param ~digitalio.DigitalInOut backlight: The backlight pin, usually - the last pin. Check with your datasheet + """ + Interfaces with a character LCD + :param ~digitalio.DigitalInOut rs: The reset data line + :param ~digitalio.DigitalInOut en: The enable data line + :param ~digitalio.DigitalInOut d4: The data line 4 + :param ~digitalio.DigitalInOut d5: The data line 5 + :param ~digitalio.DigitalInOut d6: The data line 6 + :param ~digitalio.DigitalInOut d7: The data line 7 + :param cols: The columns on the charLCD + :param lines: The lines on the charLCD + :param ~digitalio.DigitalInOut backlight: The backlight pin, usually + the last pin. Check with your datasheet """ #pylint: disable-msg=too-many-arguments def __init__(self, rs, en, d4, d5, d6, d7, cols, lines, @@ -180,8 +181,10 @@ def clear(self): time.sleep(0.003) def show_cursor(self, show): - """Show or hide the cursor - :param show: True to show cursor, False to hide + """ + Show or hide the cursor + + :param show: True to show cursor, False to hide """ if show: self.displaycontrol |= LCD_CURSORON @@ -190,9 +193,11 @@ def show_cursor(self, show): self._write8(LCD_DISPLAYCONTROL | self.displaycontrol) def set_cursor(self, col, row): - """Sets the cursor to ``row`` and ``col`` - :param col: column location - :param row: row location + """ + Sets the cursor to ``row`` and ``col`` + + :param col: column location + :param row: row location """ # Clamp row to the last row of the display if row > self.lines: @@ -201,8 +206,10 @@ def set_cursor(self, col, row): self._write8(LCD_SETDDRAMADDR | (col + LCD_ROW_OFFSETS[row])) def blink(self, blink): - """Blinks the cursor if blink = true. - :param blink: True to blink, False no blink + """ + Blinks the cursor if blink = true. + + :param blink: True to blink, False no blink """ if blink is True: self.displaycontrol |= LCD_BLINKON @@ -229,8 +236,10 @@ def set_right_to_left(self): self._write8(LCD_ENTRYMODESET | self.displaymode) def enable_display(self, enable): - """Enable or disable the display. - :param enable: True to enable display, False to disable + """ + Enable or disable the display. + + :param enable: True to enable display, False to disable """ if enable: self.displaycontrol |= LCD_DISPLAYON @@ -272,8 +281,10 @@ def _pulse_enable(self): time.sleep(0.0000001) def set_backlight(self, lighton): - """ Set lighton to turn the charLCD backlight on. - :param lighton: True to turn backlight on, False to turn off + """ + Set lighton to turn the charLCD backlight on. + + :param lighton: True to turn backlight on, False to turn off """ if lighton: self.backlight.value = 0 @@ -282,8 +293,10 @@ def set_backlight(self, lighton): def message(self, text): - """Write text to display, can include \n for newline - :param text: string to display + """ + Write text to display, can include \n for newline + + :param text: string to display """ line = 0 # iterate thru each char @@ -304,8 +317,9 @@ def create_char(self, location, pattern): provide an array of 8 bytes containing the pattern. E.g. you can easyly design your custom character at http://www.quinapalus.com/hd44780udg.html To show your custom character use eg. lcd.message('\x01') - :param location: integer in range(8) to store the created character - :param ~bytes pattern: len(8) describes created character + + :param location: integer in range(8) to store the created character + :param ~bytes pattern: len(8) describes created character """ # only position 0..7 are allowed From c0a05de200a189d6cda190aadb91eb1478908e2c Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:07:46 -0600 Subject: [PATCH 07/50] more sphinx fix --- adafruit_character_lcd/character_lcd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index dd90a63..dcdbff4 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -294,7 +294,7 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display, can include \n for newline + Write text to display, can include ``\n`` for newline :param text: string to display """ @@ -312,7 +312,8 @@ def message(self, text): self._write8(ord(char), True) def create_char(self, location, pattern): - """Fill one of the first 8 CGRAM locations with custom characters. + """ + Fill one of the first 8 CGRAM locations with custom characters. The location parameter should be between 0 and 7 and pattern should provide an array of 8 bytes containing the pattern. E.g. you can easyly design your custom character at http://www.quinapalus.com/hd44780udg.html From 833de06a4ab8d6524f327529f75483c7e55dc41f Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:11:43 -0600 Subject: [PATCH 08/50] more trial-n-error sphinx fixes --- adafruit_character_lcd/character_lcd.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index dcdbff4..646c6d2 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -125,6 +125,7 @@ class Character_LCD(object): :param lines: The lines on the charLCD :param ~digitalio.DigitalInOut backlight: The backlight pin, usually the last pin. Check with your datasheet + """ #pylint: disable-msg=too-many-arguments def __init__(self, rs, en, d4, d5, d6, d7, cols, lines, @@ -185,6 +186,7 @@ def show_cursor(self, show): Show or hide the cursor :param show: True to show cursor, False to hide + """ if show: self.displaycontrol |= LCD_CURSORON @@ -198,6 +200,7 @@ def set_cursor(self, col, row): :param col: column location :param row: row location + """ # Clamp row to the last row of the display if row > self.lines: @@ -210,6 +213,7 @@ def blink(self, blink): Blinks the cursor if blink = true. :param blink: True to blink, False no blink + """ if blink is True: self.displaycontrol |= LCD_BLINKON @@ -240,6 +244,7 @@ def enable_display(self, enable): Enable or disable the display. :param enable: True to enable display, False to disable + """ if enable: self.displaycontrol |= LCD_DISPLAYON @@ -285,6 +290,7 @@ def set_backlight(self, lighton): Set lighton to turn the charLCD backlight on. :param lighton: True to turn backlight on, False to turn off + """ if lighton: self.backlight.value = 0 @@ -297,6 +303,7 @@ def message(self, text): Write text to display, can include ``\n`` for newline :param text: string to display + """ line = 0 # iterate thru each char From 715182f8c4ec388cc8cf869d7be20e8e06e9bc17 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:41:17 -0600 Subject: [PATCH 09/50] sphinx; stubborn 'block quote ends without blank line' won't budge --- adafruit_character_lcd/character_lcd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 646c6d2..43a1afd 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -303,8 +303,9 @@ def message(self, text): Write text to display, can include ``\n`` for newline :param text: string to display - + """ + line = 0 # iterate thru each char for char in text: From 2b197dce17474b8eeccd015d76f22efbf87b1604 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:45:35 -0600 Subject: [PATCH 10/50] pylint fixes; still trying sphinx fix --- adafruit_character_lcd/character_lcd.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 43a1afd..de15dcb 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -125,7 +125,7 @@ class Character_LCD(object): :param lines: The lines on the charLCD :param ~digitalio.DigitalInOut backlight: The backlight pin, usually the last pin. Check with your datasheet - + """ #pylint: disable-msg=too-many-arguments def __init__(self, rs, en, d4, d5, d6, d7, cols, lines, @@ -186,7 +186,7 @@ def show_cursor(self, show): Show or hide the cursor :param show: True to show cursor, False to hide - + """ if show: self.displaycontrol |= LCD_CURSORON @@ -200,7 +200,7 @@ def set_cursor(self, col, row): :param col: column location :param row: row location - + """ # Clamp row to the last row of the display if row > self.lines: @@ -213,7 +213,7 @@ def blink(self, blink): Blinks the cursor if blink = true. :param blink: True to blink, False no blink - + """ if blink is True: self.displaycontrol |= LCD_BLINKON @@ -244,7 +244,7 @@ def enable_display(self, enable): Enable or disable the display. :param enable: True to enable display, False to disable - + """ if enable: self.displaycontrol |= LCD_DISPLAYON @@ -290,7 +290,7 @@ def set_backlight(self, lighton): Set lighton to turn the charLCD backlight on. :param lighton: True to turn backlight on, False to turn off - + """ if lighton: self.backlight.value = 0 @@ -300,7 +300,7 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display, can include ``\n`` for newline + Write text to display, can include ``\n`` for newline. :param text: string to display From 2a6c1c7a9c08c9d8f8d6974277a637698d8b7092 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:54:06 -0600 Subject: [PATCH 11/50] still trying to get sphinx to build --- adafruit_character_lcd/character_lcd.py | 35 +++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index de15dcb..577fe53 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -1,4 +1,3 @@ -"""Character_LCD - module for interfacing with character lcds # The MIT License (MIT) # # Copyright (c) 2017 Brent Rubell for Adafruit Industries @@ -20,16 +19,32 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +""" `adafruit_CircuitPython_CharLCD` ==================================================== + +Character_LCD - module for interfacing with character lcds module for interfacing with character lcds + * Author(s): --Brent Rubell --Asher Lieber --Tony DiCola for the original python charLCD library + -Brent Rubell + -Asher Lieber + -Tony DiCola for the original python charLCD library + +Implementation Notes +-------------------- + +**Hardware:** + +* Adafruit `Character LCDs + `_ -:mod:`adafruit_character_lcd` -================================================= -module for interfacing with character lcds""" +**Software and Dependencies:** + +* Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards: + https://github.com/adafruit/circuitpython/releases +* Adafruit's Bus Device library (when using I2C/SPI): https://github.com/adafruit/Adafruit_CircuitPython_BusDevice + +""" import time import digitalio @@ -300,12 +315,10 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display, can include ``\n`` for newline. - - :param text: string to display + Write text to display. Can include ``\n`` for newline. + :param text: text string to display """ - line = 0 # iterate thru each char for char in text: From f6a72cab0d39916424e90c9e2133d9f1772f339b Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:18:08 -0600 Subject: [PATCH 12/50] sphinx fix; think it was an unescaped use of '\n' --- adafruit_character_lcd/character_lcd.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 577fe53..08f309d 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -23,7 +23,8 @@ `adafruit_CircuitPython_CharLCD` ==================================================== -Character_LCD - module for interfacing with character lcds module for interfacing with character lcds +Character_LCD - module for interfacing with character lcds module for interfacing with character +lcds * Author(s): -Brent Rubell @@ -42,7 +43,8 @@ * Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards: https://github.com/adafruit/circuitpython/releases -* Adafruit's Bus Device library (when using I2C/SPI): https://github.com/adafruit/Adafruit_CircuitPython_BusDevice +* Adafruit's Bus Device library (when using I2C/SPI): + https://github.com/adafruit/Adafruit_CircuitPython_BusDevice """ @@ -315,7 +317,7 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display. Can include ``\n`` for newline. + Write text to display. Can include \\``\n``\\ for newline. :param text: text string to display """ From 18a9a0216a5275b08f7061b3b50036f0528f5c13 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:35:52 -0600 Subject: [PATCH 13/50] still trying to escape '\n' --- adafruit_character_lcd/character_lcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 08f309d..67a2fa5 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -317,7 +317,7 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display. Can include \\``\n``\\ for newline. + Write text to display. Can include ``\\n`` for newline. :param text: text string to display """ From f8e36ddd2d2ae791335d1f5ae981c1a8d6519dee Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:39:58 -0600 Subject: [PATCH 14/50] added adafruit_character_lcd to conf.py automock --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 63a367a..86b0377 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 = ["micropython", "digitalio", "addfruit_bus_device"] +autodoc_mock_imports = ["micropython", "digitalio", "addfruit_bus_device", "adafruit_character_lcd"] intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)} From 9f24a0acad1f48d93292dfa26ce2f4ad4e0125ac Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:53:25 -0600 Subject: [PATCH 15/50] updated api.rst --- docs/api.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 96b1a0d..a7ecd31 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,12 +1,8 @@ -`Character_LCD` - for interfacing with character lcds -+++++++++++++++++++++++++++++++++++++++++++++++++++++ +.. If you created a package, create one automodule per module in the package. .. automodule:: adafruit_character_lcd.character_lcd :members: -`Character_LCD_RGB` - for interfacing with RGB character lcds -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - .. automodule:: adafruit_character_lcd.character_lcd_RGB :members: From 387f690d850fd42b80ec97079c933fcc96a46e76 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:58:32 -0600 Subject: [PATCH 16/50] updated title docstrings --- adafruit_character_lcd/character_lcd.py | 3 +-- adafruit_character_lcd/character_lcd_rgb.py | 27 +++++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 67a2fa5..2a07a63 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -23,8 +23,7 @@ `adafruit_CircuitPython_CharLCD` ==================================================== -Character_LCD - module for interfacing with character lcds module for interfacing with character -lcds +Character_LCD - module for interfacing with monochromatic character LCDs * Author(s): -Brent Rubell diff --git a/adafruit_character_lcd/character_lcd_rgb.py b/adafruit_character_lcd/character_lcd_rgb.py index 3469cee..23160a4 100755 --- a/adafruit_character_lcd/character_lcd_rgb.py +++ b/adafruit_character_lcd/character_lcd_rgb.py @@ -1,4 +1,3 @@ -"""Character_LCD_RGB - module for interfacing with character lcds # The MIT License (MIT) # # Copyright (c) 2017 Brent Rubell for Adafruit Industries @@ -20,20 +19,32 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - +""" `adafruit_CircuitPython_CharLCD` ==================================================== +Character_LCD - module for interfacing with RGB character LCDs * Author(s): --Brent Rubell --Asher Lieber --Tony DiCola for the original python charLCD library + -Brent Rubell + -Asher Lieber + -Tony DiCola for the original python charLCD library + +Implementation Notes +-------------------- + +**Hardware:** + +* Adafruit `Character LCDs + `_ + +**Software and Dependencies:** +* Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards: + https://github.com/adafruit/circuitpython/releases +* Adafruit's Bus Device library (when using I2C/SPI): + https://github.com/adafruit/Adafruit_CircuitPython_BusDevice -:mod:`adafruit_character_lcd_RGB` -================================================= -module for interfacing with RGB character lcds """ import time import digitalio From a1277690fd037d471fe4e70a9a7c9d74c7a0c808 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 16:01:55 -0600 Subject: [PATCH 17/50] updated api.rst...again --- docs/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index a7ecd31..a6fe5af 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -4,5 +4,5 @@ .. automodule:: adafruit_character_lcd.character_lcd :members: -.. automodule:: adafruit_character_lcd.character_lcd_RGB +.. automodule:: adafruit_character_lcd.character_lcd_rgb :members: From bc6bfe634709132b9646aba05ca22a9f4c8b3cb8 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 16:08:35 -0600 Subject: [PATCH 18/50] more sphinx api title fixes --- adafruit_character_lcd/character_lcd.py | 2 +- adafruit_character_lcd/character_lcd_rgb.py | 2 +- docs/api.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 2a07a63..abcfc7f 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_CircuitPython_CharLCD` +`adafruit_character_lcd.character.lcd` ==================================================== Character_LCD - module for interfacing with monochromatic character LCDs diff --git a/adafruit_character_lcd/character_lcd_rgb.py b/adafruit_character_lcd/character_lcd_rgb.py index 23160a4..25421f6 100755 --- a/adafruit_character_lcd/character_lcd_rgb.py +++ b/adafruit_character_lcd/character_lcd_rgb.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_CircuitPython_CharLCD` +`adafruit_character_lcd.character_lcd_rgb` ==================================================== Character_LCD - module for interfacing with RGB character LCDs diff --git a/docs/api.rst b/docs/api.rst index a6fe5af..0d0fecc 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -5,4 +5,4 @@ :members: .. automodule:: adafruit_character_lcd.character_lcd_rgb - :members: + :members: From 56dbdfafdc1718bc3f9938663fce274db222c0ac Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 16:13:23 -0600 Subject: [PATCH 19/50] fixed typo --- adafruit_character_lcd/character_lcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index abcfc7f..6421ae7 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_character_lcd.character.lcd` +`adafruit_character_lcd.character_lcd` ==================================================== Character_LCD - module for interfacing with monochromatic character LCDs From c6d678b943b4bee4a11654ae389c8247bc9ae375 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 16:18:43 -0600 Subject: [PATCH 20/50] still debugging api-no-title shpinx --- docs/api.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 0d0fecc..fdb9d6c 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2,7 +2,4 @@ .. If you created a package, create one automodule per module in the package. .. automodule:: adafruit_character_lcd.character_lcd - :members: - -.. automodule:: adafruit_character_lcd.character_lcd_rgb - :members: + :members: \ No newline at end of file From 060f58e6dcb0e98c756a7cef1979303d5007685c Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 17:04:12 -0600 Subject: [PATCH 21/50] still debugging api-no-title shpinx --- adafruit_character_lcd/character_lcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 6421ae7..f070880 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_character_lcd.character_lcd` +`character_lcd` ==================================================== Character_LCD - module for interfacing with monochromatic character LCDs From 36fa08eb3e63016ea2c6096a2189ac5bdd344e89 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 17:11:15 -0600 Subject: [PATCH 22/50] still debugging api-no-title shpinx --- adafruit_character_lcd/mcp23008.py | 13 ++++++++++--- adafruit_character_lcd/shift_reg_74hc595.py | 9 +++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/adafruit_character_lcd/mcp23008.py b/adafruit_character_lcd/mcp23008.py index 37ee763..e777121 100644 --- a/adafruit_character_lcd/mcp23008.py +++ b/adafruit_character_lcd/mcp23008.py @@ -1,10 +1,17 @@ -"""MCP23008 I2C GPIO Extender Driver +""" +`adafruit_character_lcd.mcp23008` +========================================= + +MCP23008 I2C GPIO Extender Driver Bare-bones driver for the MCP23008 driver, as used by the character LCD backpack. This exposes the MCP2308 and its pins as standard CircuitPython digitalio pins. Currently this is integrated in the character LCD class for simplicity and reduction in dependent imports, but it could be broken out -into a standalone library later.""" -# Author: Tony DiCola +into a standalone library later. + +* Author: Tony DiCola + +""" import digitalio import adafruit_bus_device.i2c_device as i2c_device diff --git a/adafruit_character_lcd/shift_reg_74hc595.py b/adafruit_character_lcd/shift_reg_74hc595.py index 87e847d..bc52de5 100644 --- a/adafruit_character_lcd/shift_reg_74hc595.py +++ b/adafruit_character_lcd/shift_reg_74hc595.py @@ -1,11 +1,16 @@ -"""74HC595 Serial to Paralllel Shift Register Driver +""" +`adafruit_character_led.shift_reg_74hc595` +=============================================== + +74HC595 Serial to Paralllel Shift Register Driver Bare-bones driver for the 74HC595, as used by the character LCD backpack. This exposes the 74HC595 and its pins as standard CircuitPython digitalio pins. Currently this is integrated in the character LCD class for simplicity and reduction in dependent imports, but it could be broken out into a standalone library later. + +* Author: Tony DiCola """ -# Author: Tony DiCola import digitalio import adafruit_bus_device.spi_device as spi_device From 916f7e2e4101de0af861010297cc8059eebfe872 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 17:14:43 -0600 Subject: [PATCH 23/50] requirements missing bus_device --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8b13789..c47d35a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ - +adafruit-circuitpython-bus-device From 9013a840e2abb6903f8dc7a4fb88e2f5b201728a Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 17:18:45 -0600 Subject: [PATCH 24/50] still debugging api-no-title shpinx --- adafruit_character_lcd/character_lcd.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index f070880..4b5abd9 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -20,15 +20,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`character_lcd` +`adafruit_character_lcd.character_lcd` ==================================================== -Character_LCD - module for interfacing with monochromatic character LCDs +Module for interfacing with monochromatic character LCDs -* Author(s): - -Brent Rubell - -Asher Lieber - -Tony DiCola for the original python charLCD library +* Author(s): Brent Rubell, Asher Lieber, Tony DiCola (original python charLCD library) Implementation Notes -------------------- From f797411e1eb773cec1ec31b41befd93b74b26a99 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 4 Mar 2018 19:36:15 -0600 Subject: [PATCH 25/50] sphinx api title fix --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 86b0377..63a367a 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 = ["micropython", "digitalio", "addfruit_bus_device", "adafruit_character_lcd"] +autodoc_mock_imports = ["micropython", "digitalio", "addfruit_bus_device"] intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)} From f3ed452b0548247cf56a0044eeaa11daa5635a75 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 12:53:26 -0600 Subject: [PATCH 26/50] renamed some examples --- .../{hello_CircuitPython_I2C.py => charlcd_I2C_simpletest.py} | 0 .../{hello_CircuitPython_SPI.py => charlcd_SPI_simpletest.py} | 0 examples/{hello_CircuitPython.py => charlcd_mono_simpletest.py} | 0 .../{rgb_hello_CircuitPython.py => charlcd_rgb_simpletest.py} | 0 4 files changed, 0 insertions(+), 0 deletions(-) rename examples/{hello_CircuitPython_I2C.py => charlcd_I2C_simpletest.py} (100%) rename examples/{hello_CircuitPython_SPI.py => charlcd_SPI_simpletest.py} (100%) rename examples/{hello_CircuitPython.py => charlcd_mono_simpletest.py} (100%) rename examples/{rgb_hello_CircuitPython.py => charlcd_rgb_simpletest.py} (100%) diff --git a/examples/hello_CircuitPython_I2C.py b/examples/charlcd_I2C_simpletest.py similarity index 100% rename from examples/hello_CircuitPython_I2C.py rename to examples/charlcd_I2C_simpletest.py diff --git a/examples/hello_CircuitPython_SPI.py b/examples/charlcd_SPI_simpletest.py similarity index 100% rename from examples/hello_CircuitPython_SPI.py rename to examples/charlcd_SPI_simpletest.py diff --git a/examples/hello_CircuitPython.py b/examples/charlcd_mono_simpletest.py similarity index 100% rename from examples/hello_CircuitPython.py rename to examples/charlcd_mono_simpletest.py diff --git a/examples/rgb_hello_CircuitPython.py b/examples/charlcd_rgb_simpletest.py similarity index 100% rename from examples/rgb_hello_CircuitPython.py rename to examples/charlcd_rgb_simpletest.py From d03b2abfa0a1f7861d97e77ca3e79c7efdd99b6a Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 13:04:54 -0600 Subject: [PATCH 27/50] setup docs folder --- docs/_static/favicon.ico | Bin 0 -> 4414 bytes api.rst => docs/api.rst | 0 conf.py => docs/conf.py | 21 ++++++++++++----- docs/examples.rst | 20 +++++++++++++++++ docs/index.rst | 47 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 83 insertions(+), 5 deletions(-) create mode 100644 docs/_static/favicon.ico rename api.rst => docs/api.rst (100%) rename conf.py => docs/conf.py (85%) create mode 100644 docs/examples.rst create mode 100644 docs/index.rst 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 efb673c7229c0a71435f72a2683e411b48df832d Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 13:06:17 -0600 Subject: [PATCH 28/50] 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 a18f1d6..d0c4a0b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -16,15 +16,16 @@ deploy: provider: releases api_key: $GITHUB_TOKEN file_glob: true - file: bundles/* + file: $TRAVIS_BUILD_DIR/bundles/* skip_cleanup: true on: tags: true install: - - pip install pylint circuitpython-build-tools + - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme script: - pylint adafruit_character_lcd/*.py - ([[ ! -d "examples" ]] || pylint --disable=missing-docstring,invalid-name examples/*.py) - circuitpython-build-bundles --filename_prefix adafruit-circuitpython-charlcd --library_location . + - cd docs && sphinx-build -E -W -b html . _build/html From f5f23d0d8e3b819a8a78eb80dc998e6b03f1ae18 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 13:13:08 -0600 Subject: [PATCH 29/50] updated README --- README.md => README.rst | 81 ++++++++++++++++++++++++++++++++++++----- 1 file changed, 71 insertions(+), 10 deletions(-) rename README.md => README.rst (50%) diff --git a/README.md b/README.rst similarity index 50% rename from README.md rename to README.rst index 795ce11..cbc7ce3 100644 --- a/README.md +++ b/README.rst @@ -2,10 +2,18 @@ Introduction ============ +.. image:: https://readthedocs.org/projects/adafruit-circuitpython-charlcd/badge/?version=latest + :target: https://circuitpython.readthedocs.io/projects/charlcd/en/latest/ + :alt: Documentation Status + +.. image :: https://img.shields.io/discord/327254708534116352.svg + :target: https://discord.gg/nBQh6qu + :alt: Discord + This library is compatible with standard Character LCDs such as: -* [Adafruit Standard LCD 16x2](https://www.adafruit.com/product/181) -* [Adafruit RGB backlight negative LCD 16x2](https://www.adafruit.com/product/399) -* [Adafruit RGB backlight negative LCD 20x4](https://www.adafruit.com/product/498) +* `Adafruit Standard LCD 16x2 `_ +* `Adafruit RGB backlight negative LCD 16x2 `_ +* `Adafruit RGB backlight negative LCD 20x4 `_ Compatible with CircuitPython Versions: 2.x @@ -13,23 +21,30 @@ Dependencies ============= This driver depends on: -* [Adafruit CircuitPython](https://github.com/adafruit/circuitpython "CircuitPython") +* `Adafruit CircuitPython `_ + +I2C & SPI displays also depend on: +* `Bus Device `_ Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading -[the Adafruit library and driver bundle.](https://github.com/adafruit/Adafruit_CircuitPython_Bundle) +`the Adafruit library and driver bundle `_. Usage Example ============= The ``Character_LCD`` class interfaces a predefined Character LCD display with CircuitPython. +.. code-block:: python + import adafruit_character_lcd You must define the data pins (``RS``, ``EN``, ``D4``, ``D5``, ``D6``, ``D7``) in your code before using the ``Character_LCD`` class. If you want to have on/off ``backlight`` functionality, you can also define your backlight as ``lcd_backlight``. Otherwise, the backlight will always remain on. An example of this is below +.. code-block:: python + lcd_rs = digitalio.DigitalInOut(D7) lcd_en = digitalio.DigitalInOut(D8) lcd_d7 = digitalio.DigitalInOut(D12) @@ -40,16 +55,22 @@ If you want to have on/off ``backlight`` functionality, you can also define your You must also define the size of the CharLCD by specifying its ``lcd_columns`` and ``lcd_rows``: +.. code-block:: python + lcd_columns = 16 lcd_rows = 2 After you have set up your LCD, we can make the device by calling it +.. code-block:: python + lcd = adafruit_character_lcd.Character_LCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight) To verify that your pins are correct, print a hello message to the CharLCD: +.. code-block:: python + lcd.message('hello\ncircuitpython') @@ -73,9 +94,49 @@ To install: #. Download and unzip the `latest release zip `_. #. Copy the unzipped ``adafruit_character_lcd`` to the ``lib`` directory on the ``CIRCUITPY`` or ``MICROPYTHON`` drive. -API -=== -.. toctree:: - :maxdepth: 3 +Building locally +================ + +To build this library locally you'll need to install the +`circuitpython-build-tools `_ package. + +.. code-block:: shell + + python3 -m venv .env + source .env/bin/activate + pip install circuitpython-build-tools + +Once installed, make sure you are in the virtual environment: + +.. code-block:: shell + + source .env/bin/activate + +Then run the build: + +.. code-block:: shell + + circuitpython-build-bundles --filename_prefix adafruit-circuitpython-charlcd --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 - api +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. \ No newline at end of file From 4eb0758144b117e1dba32c59d1aeaa74cc09a2db Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 13:23:57 -0600 Subject: [PATCH 30/50] sphinx fix --- adafruit_character_lcd/character_lcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index b516c49..d094ff1 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -123,7 +123,7 @@ class Character_LCD(object): :param cols: The columns on the charLCD :param lines: The lines on the charLCD :param ~digitalio.DigitalInOut backlight: The backlight pin, usually - the last pin. Check with your datasheet + the last pin. Check with your datasheet """ #pylint: disable-msg=too-many-arguments def __init__(self, rs, en, d4, d5, d6, d7, cols, lines, From c9da84a15781915e97e4b607f97ada8637790bae Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:01:48 -0600 Subject: [PATCH 31/50] sphinx fixes; docstring indentation --- adafruit_character_lcd/character_lcd.py | 66 +++++++++++++++---------- 1 file changed, 40 insertions(+), 26 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index d094ff1..dd90a63 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -113,17 +113,18 @@ def _set_bit(byte_value, position, val): #pylint: disable-msg=too-many-instance-attributes class Character_LCD(object): - """ Interfaces with a character LCD - :param ~digitalio.DigitalInOut rs: The reset data line - :param ~digitalio.DigitalInOut en: The enable data line - :param ~digitalio.DigitalInOut d4: The data line 4 - :param ~digitalio.DigitalInOut d5: The data line 5 - :param ~digitalio.DigitalInOut d6: The data line 6 - :param ~digitalio.DigitalInOut d7: The data line 7 - :param cols: The columns on the charLCD - :param lines: The lines on the charLCD - :param ~digitalio.DigitalInOut backlight: The backlight pin, usually - the last pin. Check with your datasheet + """ + Interfaces with a character LCD + :param ~digitalio.DigitalInOut rs: The reset data line + :param ~digitalio.DigitalInOut en: The enable data line + :param ~digitalio.DigitalInOut d4: The data line 4 + :param ~digitalio.DigitalInOut d5: The data line 5 + :param ~digitalio.DigitalInOut d6: The data line 6 + :param ~digitalio.DigitalInOut d7: The data line 7 + :param cols: The columns on the charLCD + :param lines: The lines on the charLCD + :param ~digitalio.DigitalInOut backlight: The backlight pin, usually + the last pin. Check with your datasheet """ #pylint: disable-msg=too-many-arguments def __init__(self, rs, en, d4, d5, d6, d7, cols, lines, @@ -180,8 +181,10 @@ def clear(self): time.sleep(0.003) def show_cursor(self, show): - """Show or hide the cursor - :param show: True to show cursor, False to hide + """ + Show or hide the cursor + + :param show: True to show cursor, False to hide """ if show: self.displaycontrol |= LCD_CURSORON @@ -190,9 +193,11 @@ def show_cursor(self, show): self._write8(LCD_DISPLAYCONTROL | self.displaycontrol) def set_cursor(self, col, row): - """Sets the cursor to ``row`` and ``col`` - :param col: column location - :param row: row location + """ + Sets the cursor to ``row`` and ``col`` + + :param col: column location + :param row: row location """ # Clamp row to the last row of the display if row > self.lines: @@ -201,8 +206,10 @@ def set_cursor(self, col, row): self._write8(LCD_SETDDRAMADDR | (col + LCD_ROW_OFFSETS[row])) def blink(self, blink): - """Blinks the cursor if blink = true. - :param blink: True to blink, False no blink + """ + Blinks the cursor if blink = true. + + :param blink: True to blink, False no blink """ if blink is True: self.displaycontrol |= LCD_BLINKON @@ -229,8 +236,10 @@ def set_right_to_left(self): self._write8(LCD_ENTRYMODESET | self.displaymode) def enable_display(self, enable): - """Enable or disable the display. - :param enable: True to enable display, False to disable + """ + Enable or disable the display. + + :param enable: True to enable display, False to disable """ if enable: self.displaycontrol |= LCD_DISPLAYON @@ -272,8 +281,10 @@ def _pulse_enable(self): time.sleep(0.0000001) def set_backlight(self, lighton): - """ Set lighton to turn the charLCD backlight on. - :param lighton: True to turn backlight on, False to turn off + """ + Set lighton to turn the charLCD backlight on. + + :param lighton: True to turn backlight on, False to turn off """ if lighton: self.backlight.value = 0 @@ -282,8 +293,10 @@ def set_backlight(self, lighton): def message(self, text): - """Write text to display, can include \n for newline - :param text: string to display + """ + Write text to display, can include \n for newline + + :param text: string to display """ line = 0 # iterate thru each char @@ -304,8 +317,9 @@ def create_char(self, location, pattern): provide an array of 8 bytes containing the pattern. E.g. you can easyly design your custom character at http://www.quinapalus.com/hd44780udg.html To show your custom character use eg. lcd.message('\x01') - :param location: integer in range(8) to store the created character - :param ~bytes pattern: len(8) describes created character + + :param location: integer in range(8) to store the created character + :param ~bytes pattern: len(8) describes created character """ # only position 0..7 are allowed From 05cc3f31b01fbd644093a098803054f59a512a96 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:07:46 -0600 Subject: [PATCH 32/50] more sphinx fix --- adafruit_character_lcd/character_lcd.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index dd90a63..dcdbff4 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -294,7 +294,7 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display, can include \n for newline + Write text to display, can include ``\n`` for newline :param text: string to display """ @@ -312,7 +312,8 @@ def message(self, text): self._write8(ord(char), True) def create_char(self, location, pattern): - """Fill one of the first 8 CGRAM locations with custom characters. + """ + Fill one of the first 8 CGRAM locations with custom characters. The location parameter should be between 0 and 7 and pattern should provide an array of 8 bytes containing the pattern. E.g. you can easyly design your custom character at http://www.quinapalus.com/hd44780udg.html From 79b908c3a1fba91326d4b246588d929d6f45510e Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:11:43 -0600 Subject: [PATCH 33/50] more trial-n-error sphinx fixes --- adafruit_character_lcd/character_lcd.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index dcdbff4..646c6d2 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -125,6 +125,7 @@ class Character_LCD(object): :param lines: The lines on the charLCD :param ~digitalio.DigitalInOut backlight: The backlight pin, usually the last pin. Check with your datasheet + """ #pylint: disable-msg=too-many-arguments def __init__(self, rs, en, d4, d5, d6, d7, cols, lines, @@ -185,6 +186,7 @@ def show_cursor(self, show): Show or hide the cursor :param show: True to show cursor, False to hide + """ if show: self.displaycontrol |= LCD_CURSORON @@ -198,6 +200,7 @@ def set_cursor(self, col, row): :param col: column location :param row: row location + """ # Clamp row to the last row of the display if row > self.lines: @@ -210,6 +213,7 @@ def blink(self, blink): Blinks the cursor if blink = true. :param blink: True to blink, False no blink + """ if blink is True: self.displaycontrol |= LCD_BLINKON @@ -240,6 +244,7 @@ def enable_display(self, enable): Enable or disable the display. :param enable: True to enable display, False to disable + """ if enable: self.displaycontrol |= LCD_DISPLAYON @@ -285,6 +290,7 @@ def set_backlight(self, lighton): Set lighton to turn the charLCD backlight on. :param lighton: True to turn backlight on, False to turn off + """ if lighton: self.backlight.value = 0 @@ -297,6 +303,7 @@ def message(self, text): Write text to display, can include ``\n`` for newline :param text: string to display + """ line = 0 # iterate thru each char From 22b6c4ebc57fef0c68ccd46577f4dab6b101edf0 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:41:17 -0600 Subject: [PATCH 34/50] sphinx; stubborn 'block quote ends without blank line' won't budge --- adafruit_character_lcd/character_lcd.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 646c6d2..43a1afd 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -303,8 +303,9 @@ def message(self, text): Write text to display, can include ``\n`` for newline :param text: string to display - + """ + line = 0 # iterate thru each char for char in text: From e9a0c59a01c570205b9a0a74515d57fcb6c650b3 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:45:35 -0600 Subject: [PATCH 35/50] pylint fixes; still trying sphinx fix --- adafruit_character_lcd/character_lcd.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 43a1afd..de15dcb 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -125,7 +125,7 @@ class Character_LCD(object): :param lines: The lines on the charLCD :param ~digitalio.DigitalInOut backlight: The backlight pin, usually the last pin. Check with your datasheet - + """ #pylint: disable-msg=too-many-arguments def __init__(self, rs, en, d4, d5, d6, d7, cols, lines, @@ -186,7 +186,7 @@ def show_cursor(self, show): Show or hide the cursor :param show: True to show cursor, False to hide - + """ if show: self.displaycontrol |= LCD_CURSORON @@ -200,7 +200,7 @@ def set_cursor(self, col, row): :param col: column location :param row: row location - + """ # Clamp row to the last row of the display if row > self.lines: @@ -213,7 +213,7 @@ def blink(self, blink): Blinks the cursor if blink = true. :param blink: True to blink, False no blink - + """ if blink is True: self.displaycontrol |= LCD_BLINKON @@ -244,7 +244,7 @@ def enable_display(self, enable): Enable or disable the display. :param enable: True to enable display, False to disable - + """ if enable: self.displaycontrol |= LCD_DISPLAYON @@ -290,7 +290,7 @@ def set_backlight(self, lighton): Set lighton to turn the charLCD backlight on. :param lighton: True to turn backlight on, False to turn off - + """ if lighton: self.backlight.value = 0 @@ -300,7 +300,7 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display, can include ``\n`` for newline + Write text to display, can include ``\n`` for newline. :param text: string to display From 7603f0d4eb8c099fd9cb9e758b6c2848af77c2c7 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 14:54:06 -0600 Subject: [PATCH 36/50] still trying to get sphinx to build --- adafruit_character_lcd/character_lcd.py | 35 +++++++++++++++++-------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index de15dcb..577fe53 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -1,4 +1,3 @@ -"""Character_LCD - module for interfacing with character lcds # The MIT License (MIT) # # Copyright (c) 2017 Brent Rubell for Adafruit Industries @@ -20,16 +19,32 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. +""" `adafruit_CircuitPython_CharLCD` ==================================================== + +Character_LCD - module for interfacing with character lcds module for interfacing with character lcds + * Author(s): --Brent Rubell --Asher Lieber --Tony DiCola for the original python charLCD library + -Brent Rubell + -Asher Lieber + -Tony DiCola for the original python charLCD library + +Implementation Notes +-------------------- + +**Hardware:** + +* Adafruit `Character LCDs + `_ -:mod:`adafruit_character_lcd` -================================================= -module for interfacing with character lcds""" +**Software and Dependencies:** + +* Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards: + https://github.com/adafruit/circuitpython/releases +* Adafruit's Bus Device library (when using I2C/SPI): https://github.com/adafruit/Adafruit_CircuitPython_BusDevice + +""" import time import digitalio @@ -300,12 +315,10 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display, can include ``\n`` for newline. - - :param text: string to display + Write text to display. Can include ``\n`` for newline. + :param text: text string to display """ - line = 0 # iterate thru each char for char in text: From d4fb21045b34c8e33a8ac7bd1edc512c1321f9ff Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:18:08 -0600 Subject: [PATCH 37/50] sphinx fix; think it was an unescaped use of '\n' --- adafruit_character_lcd/character_lcd.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 577fe53..08f309d 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -23,7 +23,8 @@ `adafruit_CircuitPython_CharLCD` ==================================================== -Character_LCD - module for interfacing with character lcds module for interfacing with character lcds +Character_LCD - module for interfacing with character lcds module for interfacing with character +lcds * Author(s): -Brent Rubell @@ -42,7 +43,8 @@ * Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards: https://github.com/adafruit/circuitpython/releases -* Adafruit's Bus Device library (when using I2C/SPI): https://github.com/adafruit/Adafruit_CircuitPython_BusDevice +* Adafruit's Bus Device library (when using I2C/SPI): + https://github.com/adafruit/Adafruit_CircuitPython_BusDevice """ @@ -315,7 +317,7 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display. Can include ``\n`` for newline. + Write text to display. Can include \\``\n``\\ for newline. :param text: text string to display """ From 8cb6a217c1a624f02d91e1612a383c215b9c1fe4 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:35:52 -0600 Subject: [PATCH 38/50] still trying to escape '\n' --- adafruit_character_lcd/character_lcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 08f309d..67a2fa5 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -317,7 +317,7 @@ def set_backlight(self, lighton): def message(self, text): """ - Write text to display. Can include \\``\n``\\ for newline. + Write text to display. Can include ``\\n`` for newline. :param text: text string to display """ From 14bc3194748a0ba4b6f7566b5a6f1e5c03fb38e7 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:39:58 -0600 Subject: [PATCH 39/50] added adafruit_character_lcd to conf.py automock --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 63a367a..86b0377 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 = ["micropython", "digitalio", "addfruit_bus_device"] +autodoc_mock_imports = ["micropython", "digitalio", "addfruit_bus_device", "adafruit_character_lcd"] intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)} From 00e4b42d457ba5e9e7243a78fd533bfbd4f5acd7 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:53:25 -0600 Subject: [PATCH 40/50] updated api.rst --- docs/api.rst | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 96b1a0d..a7ecd31 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -1,12 +1,8 @@ -`Character_LCD` - for interfacing with character lcds -+++++++++++++++++++++++++++++++++++++++++++++++++++++ +.. If you created a package, create one automodule per module in the package. .. automodule:: adafruit_character_lcd.character_lcd :members: -`Character_LCD_RGB` - for interfacing with RGB character lcds -+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ - .. automodule:: adafruit_character_lcd.character_lcd_RGB :members: From e8ceca3b54a50fc1a258a0c965c0aa6d84cfa01b Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 15:58:32 -0600 Subject: [PATCH 41/50] updated title docstrings --- adafruit_character_lcd/character_lcd.py | 3 +-- adafruit_character_lcd/character_lcd_rgb.py | 27 +++++++++++++++------ 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 67a2fa5..2a07a63 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -23,8 +23,7 @@ `adafruit_CircuitPython_CharLCD` ==================================================== -Character_LCD - module for interfacing with character lcds module for interfacing with character -lcds +Character_LCD - module for interfacing with monochromatic character LCDs * Author(s): -Brent Rubell diff --git a/adafruit_character_lcd/character_lcd_rgb.py b/adafruit_character_lcd/character_lcd_rgb.py index 3469cee..23160a4 100755 --- a/adafruit_character_lcd/character_lcd_rgb.py +++ b/adafruit_character_lcd/character_lcd_rgb.py @@ -1,4 +1,3 @@ -"""Character_LCD_RGB - module for interfacing with character lcds # The MIT License (MIT) # # Copyright (c) 2017 Brent Rubell for Adafruit Industries @@ -20,20 +19,32 @@ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. - +""" `adafruit_CircuitPython_CharLCD` ==================================================== +Character_LCD - module for interfacing with RGB character LCDs * Author(s): --Brent Rubell --Asher Lieber --Tony DiCola for the original python charLCD library + -Brent Rubell + -Asher Lieber + -Tony DiCola for the original python charLCD library + +Implementation Notes +-------------------- + +**Hardware:** + +* Adafruit `Character LCDs + `_ + +**Software and Dependencies:** +* Adafruit CircuitPython firmware (2.2.0+) for the ESP8622 and M0-based boards: + https://github.com/adafruit/circuitpython/releases +* Adafruit's Bus Device library (when using I2C/SPI): + https://github.com/adafruit/Adafruit_CircuitPython_BusDevice -:mod:`adafruit_character_lcd_RGB` -================================================= -module for interfacing with RGB character lcds """ import time import digitalio From 82487be7917e181091339746660d351c65205b7d Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 16:01:55 -0600 Subject: [PATCH 42/50] updated api.rst...again --- docs/api.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/api.rst b/docs/api.rst index a7ecd31..a6fe5af 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -4,5 +4,5 @@ .. automodule:: adafruit_character_lcd.character_lcd :members: -.. automodule:: adafruit_character_lcd.character_lcd_RGB +.. automodule:: adafruit_character_lcd.character_lcd_rgb :members: From d4a744d3719f9927324d9d608c2e2542971ba580 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 16:08:35 -0600 Subject: [PATCH 43/50] more sphinx api title fixes --- adafruit_character_lcd/character_lcd.py | 2 +- adafruit_character_lcd/character_lcd_rgb.py | 2 +- docs/api.rst | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 2a07a63..abcfc7f 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_CircuitPython_CharLCD` +`adafruit_character_lcd.character.lcd` ==================================================== Character_LCD - module for interfacing with monochromatic character LCDs diff --git a/adafruit_character_lcd/character_lcd_rgb.py b/adafruit_character_lcd/character_lcd_rgb.py index 23160a4..25421f6 100755 --- a/adafruit_character_lcd/character_lcd_rgb.py +++ b/adafruit_character_lcd/character_lcd_rgb.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_CircuitPython_CharLCD` +`adafruit_character_lcd.character_lcd_rgb` ==================================================== Character_LCD - module for interfacing with RGB character LCDs diff --git a/docs/api.rst b/docs/api.rst index a6fe5af..0d0fecc 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -5,4 +5,4 @@ :members: .. automodule:: adafruit_character_lcd.character_lcd_rgb - :members: + :members: From 79647c0d8476db10558a875adf037e9b7d9d2e72 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 16:13:23 -0600 Subject: [PATCH 44/50] fixed typo --- adafruit_character_lcd/character_lcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index abcfc7f..6421ae7 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_character_lcd.character.lcd` +`adafruit_character_lcd.character_lcd` ==================================================== Character_LCD - module for interfacing with monochromatic character LCDs From 0e2879287780a7d8442834375f48febe254f6d81 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 16:18:43 -0600 Subject: [PATCH 45/50] still debugging api-no-title shpinx --- docs/api.rst | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/docs/api.rst b/docs/api.rst index 0d0fecc..fdb9d6c 100644 --- a/docs/api.rst +++ b/docs/api.rst @@ -2,7 +2,4 @@ .. If you created a package, create one automodule per module in the package. .. automodule:: adafruit_character_lcd.character_lcd - :members: - -.. automodule:: adafruit_character_lcd.character_lcd_rgb - :members: + :members: \ No newline at end of file From 2079f906179a8483a5e60f75b622dc7acef4ee38 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 17:04:12 -0600 Subject: [PATCH 46/50] still debugging api-no-title shpinx --- adafruit_character_lcd/character_lcd.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index 6421ae7..f070880 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -20,7 +20,7 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`adafruit_character_lcd.character_lcd` +`character_lcd` ==================================================== Character_LCD - module for interfacing with monochromatic character LCDs From 304a6ca3646bb37dd5d20cef9a02a459601e856d Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 17:11:15 -0600 Subject: [PATCH 47/50] still debugging api-no-title shpinx --- adafruit_character_lcd/mcp23008.py | 13 ++++++++++--- adafruit_character_lcd/shift_reg_74hc595.py | 9 +++++++-- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/adafruit_character_lcd/mcp23008.py b/adafruit_character_lcd/mcp23008.py index 37ee763..e777121 100644 --- a/adafruit_character_lcd/mcp23008.py +++ b/adafruit_character_lcd/mcp23008.py @@ -1,10 +1,17 @@ -"""MCP23008 I2C GPIO Extender Driver +""" +`adafruit_character_lcd.mcp23008` +========================================= + +MCP23008 I2C GPIO Extender Driver Bare-bones driver for the MCP23008 driver, as used by the character LCD backpack. This exposes the MCP2308 and its pins as standard CircuitPython digitalio pins. Currently this is integrated in the character LCD class for simplicity and reduction in dependent imports, but it could be broken out -into a standalone library later.""" -# Author: Tony DiCola +into a standalone library later. + +* Author: Tony DiCola + +""" import digitalio import adafruit_bus_device.i2c_device as i2c_device diff --git a/adafruit_character_lcd/shift_reg_74hc595.py b/adafruit_character_lcd/shift_reg_74hc595.py index 87e847d..bc52de5 100644 --- a/adafruit_character_lcd/shift_reg_74hc595.py +++ b/adafruit_character_lcd/shift_reg_74hc595.py @@ -1,11 +1,16 @@ -"""74HC595 Serial to Paralllel Shift Register Driver +""" +`adafruit_character_led.shift_reg_74hc595` +=============================================== + +74HC595 Serial to Paralllel Shift Register Driver Bare-bones driver for the 74HC595, as used by the character LCD backpack. This exposes the 74HC595 and its pins as standard CircuitPython digitalio pins. Currently this is integrated in the character LCD class for simplicity and reduction in dependent imports, but it could be broken out into a standalone library later. + +* Author: Tony DiCola """ -# Author: Tony DiCola import digitalio import adafruit_bus_device.spi_device as spi_device From 035fc25dd9527aa040f0b8ddd85efb4de0130881 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 17:14:43 -0600 Subject: [PATCH 48/50] requirements missing bus_device --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 8b13789..c47d35a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1 @@ - +adafruit-circuitpython-bus-device From 116e651bbce5f6e7bb7f0b5594ed58c203a30f12 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sat, 24 Feb 2018 17:18:45 -0600 Subject: [PATCH 49/50] still debugging api-no-title shpinx --- adafruit_character_lcd/character_lcd.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/adafruit_character_lcd/character_lcd.py b/adafruit_character_lcd/character_lcd.py index f070880..4b5abd9 100644 --- a/adafruit_character_lcd/character_lcd.py +++ b/adafruit_character_lcd/character_lcd.py @@ -20,15 +20,12 @@ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN # THE SOFTWARE. """ -`character_lcd` +`adafruit_character_lcd.character_lcd` ==================================================== -Character_LCD - module for interfacing with monochromatic character LCDs +Module for interfacing with monochromatic character LCDs -* Author(s): - -Brent Rubell - -Asher Lieber - -Tony DiCola for the original python charLCD library +* Author(s): Brent Rubell, Asher Lieber, Tony DiCola (original python charLCD library) Implementation Notes -------------------- From b35c7ca730ae400614773460d2feea5865b1d990 Mon Sep 17 00:00:00 2001 From: sommersoft Date: Sun, 4 Mar 2018 19:36:15 -0600 Subject: [PATCH 50/50] sphinx api title fix --- docs/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/conf.py b/docs/conf.py index 86b0377..63a367a 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 = ["micropython", "digitalio", "addfruit_bus_device", "adafruit_character_lcd"] +autodoc_mock_imports = ["micropython", "digitalio", "addfruit_bus_device"] intersphinx_mapping = {'python': ('https://docs.python.org/3.4', None),'CircuitPython': ('https://circuitpython.readthedocs.io/en/latest/', None)}