Python for 16x2 for Pi
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- gprade
- Posts: 5
- Joined: Tue Mar 25, 2014 8:44 am
Python for 16x2 for Pi
I have an existing Python 3 / RasPi ZeroW application that I would like to add external I/O. The Adafruit 16x2 Character LCD + Keypad for Raspberry Pi appears to be ideal so I purchased and built two of them but I have been unable to get them to work. The Pi OS is current and I have enabled I2C and added adafruit-circuitpython-charlcd. I am running Python 3.7 as a standard user, although I did try it as root. The program I am running is your """Simple test for monochromatic character LCD""" program; it runs without errors but the display never changes from blank. Do I need to run CircuitPython to get it to work? If so, this app is multi-threaded with MQTT - will that run unchanged on CircuitPython? If CircuitPython isn't required, any suggestions what is going wrong? Both boards have been carefully checked for cold joints or shorts and both exhibit the same behavior. Thanks for any suggestions.
- adafruit_support_carter
- Posts: 29167
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Python for 16x2 for Pi
Can you link to the product page for the specific version of the character display you are using. There are a few slightly different versions.
- gprade
- Posts: 5
- Joined: Tue Mar 25, 2014 8:44 am
Re: Python for 16x2 for Pi
These were ordered from Amazon since we were on the road. The full description is "Adafruit Blue&White 16x2 LCD+Keypad Kit for Raspberry Pi [ADA1115]". Their link is zhttps://www.amazon.com/Adafruit-White-Keypad-Ra ... 511&sr=8-2. I believe this is the same as your https://www.adafruit.com/product/1115?g ... 8gQAvD_BwE.
- adafruit_support_carter
- Posts: 29167
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Python for 16x2 for Pi
Thanks, yep that helps identify it.
As a first check, see if the board's address shows up in an I2C scan. Run this from the command line:
As a first check, see if the board's address shows up in an I2C scan. Run this from the command line:
Code: Select all
i2cdetect -y 1
- gprade
- Posts: 5
- Joined: Tue Mar 25, 2014 8:44 am
Re: Python for 16x2 for Pi
The only hit was on address 0x20
Code: Select all
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: 20 -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
- gprade
- Posts: 5
- Joined: Tue Mar 25, 2014 8:44 am
Re: Python for 16x2 for Pi
That Pi has been used for development of the app and some testing of numerous hats. I decided to rebuild a new RasPi and just load the OS and Python modules I needed. It now works and all of the sensors and relays still work. I'm not sure I can explain it but Murphy was, after all, an optimist... ;-). You can close this - and thanks for your help!
- gprade
- Posts: 5
- Joined: Tue Mar 25, 2014 8:44 am
Re: Python for 16x2 for Pi
I wanted to try to figure out what changed, so I went back over the steps. I think it was a careless mistake on my part - trying to quickly test the function, I went to the Python Docs link and picked up a module to test. Unfortunately it was the test for the discrete LCD, not the one with the I2C Pi Plate. When I rebuilt, I was a bit more careful and picked the correct test. The only suggestion is that you make the comments on the module a little clearer that it is NOT for the I2C module.
Again, thanks for your help.
Again, thanks for your help.
- adafruit_support_carter
- Posts: 29167
- Joined: Tue Nov 29, 2016 2:45 pm
Re: Python for 16x2 for Pi
Cool. Glad you figured it out. Thanks for sharing all the info about what the problem was. Hope it just works for your now. Have fun!
Please be positive and constructive with your questions and comments.