0

I am trying to run code to output to my 16x2 display, but when I try to run the python file, there is no visible output to the display, and the following is returned: "/usr/local/lib/python2.7/dist-packages/RPLCD/gpio.py:122: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIOsetwarnings(False) to disable warnings.
GPIO.setup(pin, GPIO.OUT)" I am using a standard 16x2 LCD display wired as in this picture. enter image description here

and this is the code I'm running in the python file:

from RPLCD import CharLCD     
lcd = CharLCD(cols=16, rows=2, pin_rs=37, pin_e=35, pins_data=[40, 38, 36, 32, 33, 31, 29, 23])
lcd.write_string(u'Hello world!')

Here are some images of my wiring:

enter image description here

Not sure how to fix this as I am new to python and raspberry pi

  • 1
    Are you following a tutorial? If so which one? Can you include pictures of your wiring; the diagram is nice but it shows what was intended not what is. Have you tried adjusting the contrast? Also, I think the wiring of your contrast pot is wrong normally it would have three connections (power, ground and the wiper). Adafruot has a great tutorial on driving these from a Pi learn.adafruit.com/… though it uses the simpler 4 bit wiring not the 8 bit - though that may not matter to you. – Steve Robillard Jul 25 '17 at 21:10
  • I am running off this tutorial link in the video, he only uses one side of each potentiometer, and it functions fine for him. also, I have the brightness pin wired directly to the positive rail for full brightness as I only have 1 potentiometer. As for my wiring, I'll upload a picture to the post. – Brandon Jul 25 '17 at 22:46
  • Have you gotten this to work? I too am having problems with this same tutorial. I wonder if rplcd knows about the difference between RPi1, 2 & 3. Further, I am not sure the documentation for rplcd is written w.r.t. GPIO or Connector Pin numbers. – st2000 Dec 11 '17 at 17:16
  • Note that the circuit basic tutorial is outdated, you should read the docs (rplcd.readthedocs.io/en/stable) instead. Also note that RPLCD can be used both with BOARD or BCM numbering, it's configurable using the numbering_mode parameter in the CharLCD constructor. – Danilo Bargen Mar 22 at 8:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.