Commit 387971c7 authored by zing's avatar zing

Add wrapper script for lcd.py.

The wrapper script also does some sanity checks for my Pi setup.
parent bc2c5146
#!/bin/sh
PYTHONPATH="/home/pi/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCDPlate"
export PYTHONPATH
# When switching the CharLCDPlate for an 8x8 LDE matrix,
# both boards use an MCP23017 I2C chip with the address hardwired to 0x20.
# To avoid writing garbage to the LED matrix, we make sure that the device
# looks like a CharLCDPlate:
if ! i2cget -y 1 0x20 0x13 | grep -q '^0xff$' # GPIOB input register on power on
then
if ! i2cget -y 1 0x20 0x00 | grep -q '^0x3f$' # IODIRA register after Adafruit_CharLCDPlate init
then
echo "Not a LCD Pi Plate (based on heuristics)." >&2
exit 0
fi
fi
/usr/bin/python /home/pi/lcdtools/lcd.py "$@"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment