Hardware Reference
In-Depth Information
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
Sure enough, you can see the Adafruit LCD Pi Plate on the I2C bus, as device number
20.
Now, go ahead and change into the Adafruit_CharLCDPlate/ directory within your
checkout of our GitHub repository:
$ cd rpihacks/Adafruit_CharLCDPlate
In that directory, you will see a few Python files. Most of these provide the library of
functions necessary to access the LCD Pi Plate. If you just want to test proper oper-
ation of your wiring and soldering work, you can run the Adafruit test script:
$ su -c 'python ./LCDtest.py'
This will cycle through the background colors and print text strings to the LCD when
you press the buttons on the Pi Plate. If you are using the Blue 16x2 LCD that normally
comes with this kit, it does not support different background colors, so this program
will seem to dim the background depending on which button you press. Don't get
scared if this happens.
If no visible text appears, but you can see the LCD blinking, you probably just need to
adjust the contrast. Use your fine-tipped Phillips screwdriver to turn the potentiom-
eter (it's the round knob next to the buttons with a Phillips-shaped slot in it) until text
appears.
When you're satisfied with the test script, it's time to get to the good stuff. We've
written a different Python script that, when executed, will run a simple program that
displays the IP addresses for eth0 and wlan0. It also has a crude menu structure, so
that you can push the Up and Down button on the LCD Pi Plate to switch between
displaying the IP address for eth0 and wlan0, respectively. The other buttons will re-
turn you to the menu screen.
To run that program, simply run:
$ su -c 'python ./LCD-pi-plate-demo.py'
If you want that program to run in the background, just add a & after ./LCD-pi-plate-
demo.py (but within the '' marks for the su -c invocation).
You should see this on the LCD panel:
Pi IP Addrs
UP:eth0 DN:wlan0
If you press the Up button on the LCD Pi Plate, it will try to display the address for eth0
(if any).
Search WWH ::




Custom Search