adafruit/Adafruit-Raspberry-Pi-Python-Code — pull request #6 by dberlin (2012-10-03 05:20:00+00:00)
Title: Make CharLCD work over anything that supports the GPIO interface

This makes the GPIO be an object passed to the class (defaulting to the old behavior of using RPi.GPIO). This in turn, makes it trivial to support any I2C expander that can present the same interface as RPi.GPIO (which is trivial).

For example, when used with the code at [PCA95XX](http://github.com/dberlin/PCA95XX) you can hook the LCD up to a PCA9535/PCA9555, and use code like this to have it simply work with the LCD driver without any additional modifications:

```python
from PCA95XX import PCA95XX_GPIO
from Adafruit_CharLCD import Adafruit_CharLCD

bus = PCA95XX_GPIO(0, 0x20, 16)
lcd = Adafruit_CharLCD(8, 9, [10, 11, 12, 13], bus)
```