Skip to content

Commit 32570d2

Browse files
authored
Merge pull request #19 from kattni/mcp230xx-support
Refactor complete!
2 parents 3775cd7 + af6e023 commit 32570d2

25 files changed

+1171
-1152
lines changed

README.rst

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ This library is compatible with standard Character LCDs such as:
1919
* `Adafruit RGB backlight negative LCD 16x2 <https://www.adafruit.com/product/399>`_
2020
* `Adafruit RGB backlight negative LCD 20x4 <https://www.adafruit.com/product/498>`_
2121

22-
Compatible with CircuitPython Versions: 2.x
23-
2422
Dependencies
2523
=============
2624
This driver depends on:
@@ -42,20 +40,23 @@ The ``Character_LCD`` class interfaces a predefined Character LCD display with C
4240

4341
.. code-block:: python
4442
45-
import adafruit_character_lcd
43+
import board
44+
import digitalio
45+
import adafruit_character_lcd.character_lcd as character_lcd
4646
4747
You must define the data pins (``RS``, ``EN``, ``D4``, ``D5``, ``D6``, ``D7``) in your code before using the ``Character_LCD`` class.
48-
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
48+
If you want to have on/off ``backlight`` functionality, you can also define your backlight as ``lcd_backlight``. Otherwise, the backlight
49+
will always remain on. The following is an example setup.
4950

5051
.. code-block:: python
5152
52-
lcd_rs = digitalio.DigitalInOut(D7)
53-
lcd_en = digitalio.DigitalInOut(D8)
54-
lcd_d7 = digitalio.DigitalInOut(D12)
55-
lcd_d6 = digitalio.DigitalInOut(D11)
56-
lcd_d5 = digitalio.DigitalInOut(D10)
57-
lcd_d4 = digitalio.DigitalInOut(D9)
58-
lcd_backlight = digitalio.DigitalInOut(D13)
53+
lcd_rs = digitalio.DigitalInOut(board.D7)
54+
lcd_en = digitalio.DigitalInOut(board.D8)
55+
lcd_d7 = digitalio.DigitalInOut(board.D12)
56+
lcd_d6 = digitalio.DigitalInOut(board.D11)
57+
lcd_d5 = digitalio.DigitalInOut(board.D10)
58+
lcd_d4 = digitalio.DigitalInOut(board.D9)
59+
lcd_backlight = digitalio.DigitalInOut(board.D13)
5960
6061
You must also define the size of the CharLCD by specifying its ``lcd_columns`` and ``lcd_rows``:
6162

@@ -68,17 +69,17 @@ After you have set up your LCD, we can make the device by calling it
6869

6970
.. code-block:: python
7071
71-
lcd = adafruit_character_lcd.Character_LCD(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight)
72+
lcd = character_lcd.Character_LCD_Mono(lcd_rs, lcd_en, lcd_d4, lcd_d5, lcd_d6, lcd_d7, lcd_columns, lcd_rows, lcd_backlight)
7273
7374
7475
To verify that your pins are correct, print a hello message to the CharLCD:
7576

7677
.. code-block:: python
7778
78-
lcd.message('hello\ncircuitpython')
79+
lcd.message = "Hello\nCircuitPython"
7980
8081
81-
Custom character example with create_char() is provided within /examples/
82+
Custom character example with ``create_char()`` is provided within /examples/
8283

8384

8485
Contributing
@@ -143,4 +144,4 @@ Now, once you have the virtual environment activated:
143144
144145
This will output the documentation to ``docs/_build/html``. Open the index.html in your browser to
145146
view them. It will also (due to -W) error out on any warning like Travis will. This is a good way to
146-
locally verify it will pass.
147+
locally verify it will pass.

adafruit_character_lcd/__init__.py

Lines changed: 0 additions & 3 deletions
This file was deleted.

0 commit comments

Comments
 (0)