User avatar
adafruit
Posts: 71
Joined: Sat Apr 28, 2012 3:32 pm
Location: NYC, USA
Contact: Website

How-to: Drive a 16x2 LCD with the Raspberry Pi

Sat Aug 18, 2012 1:17 pm

Image

Image

Drive a 16x2 LCD with the Raspberry Pi
Output Character Data to a Inexpensive Display

Adding a LCD to any project immediately kicks it up a notch. This tutorial explains how to connect a inexpensive HDD44780 compatible LCD to the raspberry pi using 6 GPIOs. While there are other ways to connect using I2C or the UART this is the most direct method that get right down to the bare metal.

http://learn.adafruit.com/drive-a-16x2- ... pberry-pi/

Enjoy!

hizzle
Posts: 11
Joined: Wed May 23, 2012 4:57 pm

Re: How-to: Drive a 16x2 LCD with the Raspberry Pi

Sat Sep 22, 2012 11:46 pm

So, I need help. I'm trying to get the OLED 16x2 Character display going. Without success.

Trying to run the Adafruit example python script gives me:

Code: Select all

pi@raspberrypi:~/Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCD$ sudo ./Adafruit_CharLCD.py 
Traceback (most recent call last):
  File "./Adafruit_CharLCD.py", line 9, in <module>
    import RPi.GPIO as GPIO
ImportError: No module named RPi.GPIO
As you can see I have followed the steps accordingly:

Code: Select all

pi@raspberrypi:~$ sudo apt-get install python-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-dev is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
pi@raspberrypi:~$ sudo apt-get install python-setuptools
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-setuptools is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
pi@raspberrypi:~$ sudo easy_install -U distribute
Searching for distribute
Reading http://pypi.python.org/simple/distribute/
Reading http://packages.python.org/distribute
Best match: distribute 0.6.28
Processing distribute-0.6.28-py2.6.egg
distribute 0.6.28 is already the active version in easy-install.pth
Installing easy_install script to /usr/local/bin
Installing easy_install-2.6 script to /usr/local/bin
Using /usr/local/lib/python2.6/dist-packages/distribute-0.6.28-py2.6.egg
Processing dependencies for distribute
Finished processing dependencies for distribute
pi@raspberrypi:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 39 not upgraded.
pi@raspberrypi:~$ sudo pip install rpi.gpio
Requirement already satisfied (use --upgrade to upgrade): rpi.gpio in /usr/local/lib/python2.6/dist-packages
Cleaning up...

I added the following to .bash_profile:

Code: Select all

pi@raspberrypi:~$ cat .bash_profile 
PATH=$PATH:/usr/local/lib/python2.6/dist-packages:/usr/local/lib/python2.6/site-packages

Code: Select all

pi@raspberrypi:~$ echo $PATH 
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/lib/python2.6/dist-packages:/usr/local/lib/python2.6/site-packages
Surely I am missing something simple. Please help.

hizzle
Posts: 11
Joined: Wed May 23, 2012 4:57 pm

Re: How-to: Drive a 16x2 LCD with the Raspberry Pi

Sun Sep 23, 2012 12:35 pm

oled.jpg
oled.jpg (55.86 KiB) Viewed 6610 times

EnzioBrK
Posts: 24
Joined: Wed Jan 23, 2013 9:26 pm
Location: Luton, Bedfordshire

Re: How-to: Drive a 16x2 LCD with the Raspberry Pi

Wed Jan 23, 2013 9:30 pm

Hi guys,
Is it possible to use an serial LCD ( the one with RX and TX) as a serial console?
I mean to see that lines that i see on putty.

thanks and sorry for my bad english.

Return to “Interfacing (DSI, CSI, I2C, etc.)”