This repository was archived by the owner on Sep 30, 2019. It is now read-only.
This repository was archived by the owner on Sep 30, 2019. It is now read-only.
Test script for HD44780 LCD connected to RPI via 'i2c / SPI character LCD backpack' #31
Closed
Description
I have connected a HD44780 compatible LCD to a Raspberry Pi (revB) using the 'i2c / SPI character LCD backpack' from Adafruit.
Using the library, I created the following test script:
#!/usr/bin/python
from Adafruit_CharLCD import Adafruit_CharLCD
from Adafruit_MCP230xx import MCP230XX_GPIO
mcp = MCP230XX_GPIO(1, 0x20, 8)
lcd = Adafruit_CharLCD(pin_rs=1, pin_e=2, pins_db=[3,4,5,6], GPIO=mcp)
lcd.clear()
lcd.message(" Adafruit 16x2\n Standard LCD")
Note: the following patch needs to be applied to Adafruit_MCP230xx.py:
diff --git a/Adafruit_MCP230xx/Adafruit_MCP230xx.py b/Adafruit_MCP230xx/Adafruit_MCP230xx.py
index 19bc372..cbad92d 100755
--- a/Adafruit_MCP230xx/Adafruit_MCP230xx.py
+++ b/Adafruit_MCP230xx/Adafruit_MCP230xx.py
@@ -185,7 +185,7 @@ class MCP230XX_GPIO(object):
BOARD = 0
def __init__(self, busnum, address, num_gpios):
- self.chip = Adafruit_MCP230XX(busnum, address, num_gpios)
+ self.chip = Adafruit_MCP230XX(address, num_gpios, busnum)
def setmode(self, mode):
pass # do nothing
def setup(self, pin, mode):
Metadata
Metadata
Assignees
Labels
No labels