Page 1 of 1

Most uptodate hd44780 16x2 display tutorial?

Posted: Wed Nov 18, 2015 2:08 pm
by Tom Lewis
Hey guys!
I have the first Model 2 256mb Raspberry Pi that I started to learn hardware with, but got distracted for a few years.
At one point I got my hd44780 2x16 character display running some basic text using python, I would like to find an updated tutorial for 2015, im sure the library's have all been updated and made life much easier! Can someone point me in the direction of the most upto date hd44780 wiring & programming example of sending data to this display?
I have found a reason to use this setup now so I would love to revive it!
I would also like to know how I can dim the backlight on the hd44780 using python aswell, as its too bright and would like to turn the display off at night via software!

Re: Most uptodate hd44780 16x2 display tutorial?

Posted: Wed Nov 18, 2015 2:21 pm
by RDS
I have only recently started with a Pi but one of the first things I wanted to do was connect it up to an LCD.
I raised a thread called: '16 x 2 LCD Display', which is currently on Page 8 of this forum.

I don't know if it applies to your display but I was certainly provided with all the info I needed due to the help given to me on that thread.

Re: Most uptodate hd44780 16x2 display tutorial?

Posted: Wed Nov 18, 2015 2:23 pm
by JimmyN
Here is the Adafruit guide, it appears to have been updated in April so it's pretty current.
It's a pdf file so you can download it and print it out.
https://learn.adafruit.com/downloads/pd ... rry-pi.pdf

Re: Most uptodate hd44780 16x2 display tutorial?

Posted: Wed Nov 18, 2015 3:30 pm
by Tom Lewis
JimmyN wrote:Here is the Adafruit guide, it appears to have been updated in April so it's pretty current.
It's a pdf file so you can download it and print it out.
https://learn.adafruit.com/downloads/pd ... rry-pi.pdf
Fantastic, I did find this but when it got to the software the PDF links to http://adafru.it/eYC
You can find a newer library...
The link does not work, I assume its a shortcode to the github? I thought it may lead to an updated tutorial with updated demo code.

Re: Most uptodate hd44780 16x2 display tutorial?

Posted: Wed Nov 18, 2015 4:10 pm
by JimmyN
This is their latest library, it works with RPi or the Beaglebone. It's the one I'm using for a couple of LCD displays (16x2 and a 20x4).
https://github.com/adafruit/Adafruit_Python_CharLCD

Re: Most uptodate hd44780 16x2 display tutorial?

Posted: Wed Nov 18, 2015 4:26 pm
by mikronauts
There is also my article:

http://www.mikronauts.com/raspberry-pi/ ... terfacing/
Tom Lewis wrote:Hey guys!
I have the first Model 2 256mb Raspberry Pi that I started to learn hardware with, but got distracted for a few years.
At one point I got my hd44780 2x16 character display running some basic text using python, I would like to find an updated tutorial for 2015, im sure the library's have all been updated and made life much easier! Can someone point me in the direction of the most upto date hd44780 wiring & programming example of sending data to this display?
I have found a reason to use this setup now so I would love to revive it!
I would also like to know how I can dim the backlight on the hd44780 using python aswell, as its too bright and would like to turn the display off at night via software!

Re: Most uptodate hd44780 16x2 display tutorial?

Posted: Wed Nov 18, 2015 4:56 pm
by DougieLawson
Here's some free code that I hacked together
https://github.com/DougieLawson/Raspber ... nified_LCD

Wiring is simple for the GPIO version
Image

You can control the backlight brightness by connecting the anode to pin#18 (rather than to 5V0) and using PWM. But it runs a bit dull on 3V3 so you may want to reduce the current limiting resistor between the cathode and GND.

Code: Select all

#!/bin/bash

if [ "$1" == "light" ]; then
  /usr/local/bin/gpio -g pwm 18 0
else
  /usr/local/bin/gpio -g pwm 18 1023
fi
that's just an on or off depending whether you call that script with "lcdbl.sh light" or "lcdbl.sh dark"