Tom Lewis
Posts: 22
Joined: Mon Jul 02, 2012 12:14 pm

Most uptodate hd44780 16x2 display tutorial?

Wed Nov 18, 2015 2:08 pm

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!

RDS
Posts: 736
Joined: Tue Oct 06, 2015 8:17 am
Location: Lancashire, UK

Re: Most uptodate hd44780 16x2 display tutorial?

Wed Nov 18, 2015 2:21 pm

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.

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Most uptodate hd44780 16x2 display tutorial?

Wed Nov 18, 2015 2:23 pm

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

Tom Lewis
Posts: 22
Joined: Mon Jul 02, 2012 12:14 pm

Re: Most uptodate hd44780 16x2 display tutorial?

Wed Nov 18, 2015 3:30 pm

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.

JimmyN
Posts: 1109
Joined: Wed Mar 18, 2015 7:05 pm
Location: Virginia, USA

Re: Most uptodate hd44780 16x2 display tutorial?

Wed Nov 18, 2015 4:10 pm

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

User avatar
mikronauts
Posts: 2732
Joined: Sat Jan 05, 2013 7:28 pm
Contact: Website

Re: Most uptodate hd44780 16x2 display tutorial?

Wed Nov 18, 2015 4:26 pm

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!
http://Mikronauts.com - home of EZasPi, RoboPi, Pi Rtc Dio and Pi Jumper @Mikronauts on Twitter
Advanced Robotics, I/O expansion and prototyping boards for the Raspberry Pi

User avatar
DougieLawson
Posts: 36516
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Most uptodate hd44780 16x2 display tutorial?

Wed Nov 18, 2015 4:56 pm

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"
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

Return to “Beginners”