adafruit/Adafruit-Raspberry-Pi-Python-Code — pull request #27 by bbkiwi (2013-02-13 09:40:16+00:00)
Title: Improvements and Bug Fixes to CharLCDPlate.py and MCP230xx.py

Note - this pull request superceeds those I made about 11 days ago.

Many of the routines in Adafruit-Raspberry-Pi-Python-Code have been
indented using a mixture of spacing and tab. This tends to confuse WebIDE. I have tried to tidy this up.

Some functions had comments that did not accurately reflect what
they do. I've fixed these.

CharLCDPlate.py
Added more routines - ToggleCursor(), blink(), ToggleBlink(),
read4bits(), readBF(), waitBFlow()
these later 3 being able to read information from the plate.
waitBFlow() waits till the 'busy flag' is low which means the LCD is ready for more intstructions so can replace a time delay

MCP230xx.py
Fixed some bugs
config(self, pin, mode) did not maintain a 16bit record of the
I/O state of of the pins.
input(self, pin, check=True)
fixed to return either 0 or 1 rather then 0 or various non-zero values
added parameter which defaults to previous rountine, but allows assertion to be skipped - to enable experimental reading of 'output' pins

Removed orphaned code after return in output(self, pin, value)
All the low level rountines readU8, readS8 etc. where indented so they were sub functions of input but not used there, and inaccessible in the class. Moved indentation and modified many to use the i2c routines more efficiently.

Unfortunately because I have replaced spaces with tabs the diff view shows my changes appearing as big blocks of code being removed and other blocks being added, when in fact only a small number of lines have
been changed.