LCD display + Raspberry Pi
Revision as of 17:48, 1 May 2017 by Audrey.freeman (talk | contribs)
Hardware
- Raspberry pi 3
- 16x2 LCD backlight display for raspberry pi
- 0.1" Header strip
- Breadboard
- 10k potentiometer
- Jumper Wires
Wire setup
- Solder the 0.1" header strip into the 16 pins of the LCD screen's board
- Connect the wires as shown above
- Pin 2 and 6 on raspberry pi to power and ground respectively
- On LCD pin 1 to ground, pin 2 to power, pin 3 to center of potentiometer, pin 4 to GPIO 25, pin 5 to ground, pin 6 to GPIO 24, pin 11 to GPIO 23, pin 12 to GPIO 17, pin 13 to GPIO 21, pin 14 to GPIO 22, pin 15 to power, pin 16 to ground
Software
- Choose a folder to have all files saved in for example /home/pi/Desktop/Projects/LCDTests
- Download git to clone libraries
- pi@raspberrypi $ sudo apt get update
- pi@raspberrypi $ sudo apt-get upgrade
- pi@raspberrypi $ sudo apt-get install -y git dialog
- Clone Adafruit's Char_LCD library
- pi@raspberrypi $ git clone https://github.com/adafruit/Adafruit_Python_CharLCD
- Navigate into directory
- pi@raspberrypi $ cd /home/pi/Desktop/Projects/LCDTests
- Copy the Adafruit_CharLCD.py file into directory
- pi@raspberrypi ~/home/pi/Desktop/Projects/LCDTests $ cp Adafruit-Raspberry-Pi-Python-Code/Adafruit_CharLCD/Adafruit_CharLCD.py .
- In a text editor copy the following code to test the LCD
TroubleShooting the pi
- In the terminal, if you get an error saying you do not have permission to access that file use:
- pi@raspberrypi $ sudo "rest of your command here"
- If an error appears saying file not found, make sure you are in the correct directory where the file is saved, writing the exact path on how to navigate to that directory
- For example if the file is saved in the LCDTests folder, which is inside the Projects folder, which is saved on the Desktop type
- pi@raspberrypi $ cd /home/pi/Desktop/Projects/LCDTests
- For example if the file is saved in the LCDTests folder, which is inside the Projects folder, which is saved on the Desktop type
- To run the desired program, make sure you are in the correct directory
- pi@raspberrypi /home/pi/Desktop/Projects/LCDTests $ sudo python LCD_test.py