*UPDATE:* The Adafruit Char LCD library used in the video is now deprecated. Therefore, I added an update to my website showing how to use the Adafruit CircuitPython CharLCD library: www.rototron.info/lcd-display-tutorial-for-raspberry-pi/#cp
@MattVarner9 жыл бұрын
Thank you for making this video. Although I'm really just at the beginning of my Python adventure...this sort of thing fires my daydreaming.
@iscromanpc9 жыл бұрын
The best tutorial for use a 16x2 LCD Display with a Raspberry Pi. I followed the instructions in the Adafruit site with no success. I'll try with this solution. Thanks.
@dcc11658 жыл бұрын
You filled in about 20 blanks in my mind with this video. Most confusing was with the AdaFruit library. Sunfounder's Super Kit 2.0 includes the LCD and some tutorials, but they are not very descriptive as to how thing work. This video is so simple and straight forward, I almost feel like an idiot for needing this stuff explained to me...lol
@chociiitv30348 жыл бұрын
Feel the same :D
@Havanacuba19858 жыл бұрын
Man, this was really informative and helpful. I just got my 16 x 2 display in the post this morning. When I get around to hooking it up I will be off to a good start with your video. Thanks for uploading this
@rdagger8 жыл бұрын
*UPDATE*: the Adafruit library is now installed using _pip_. It is no longer necessary to use git and the paths are automatically set up. Also the syntax for some of the commands has changed. See my website for details.
@akshaytanejaF17 жыл бұрын
how do you get the module using pip? #newbie
@rdagger7 жыл бұрын
sudo pip install adafruit-charlcd See my website for updates and more info: www.rototron.info/lcd-display-tutorial-for-raspberry-pi/
@akshaytanejaF17 жыл бұрын
Thanks! i somehow got the lcd working from the adafruit library before i read your reply but the problem im having is that when i use scrollDisplayRight() it says Adafruit_CharLCD has no such attribute i used github.com/adafruit/Adafruit_Python_CharLCD.git and installed using ez_setup.py because the normal setup file wasnt working for me im working on a music player and im willing to share the code once i complete it, im almost there i guess EDIT: just found that the function is lcd.autoscroll() but i still cant get that to work after setting it to true
@freemanfreed15815 жыл бұрын
How to Use LED display board instead of LCD??
@nabinbhandari4714 жыл бұрын
@@rdagger why have you defined path as /home/pi/lcd ? lcd.lcd_init() AttributeError: 'module' object has no attribute 'lcd_init' i m getting this error...
@andy1845c9 жыл бұрын
Excellent video. I watched the first one too and really appreciate both! Please keep making them!!
@Yeeter_Inbound2 жыл бұрын
This was awesome! Thank you so much! I used the first method for code. I didnt have one of those little modules that only makes 4 pins used and they actually are already being used for another device. I'm trying to make an alarm clock for a school project. I hope I can make this work!
@patricktucci28187 жыл бұрын
Very helpful video, thanks for posting. Just a clarification, at 10:39, you say "the columns are zero-based so (7,0) is the 6th column on the first line." If in fact the values are zero-based, 7,0 is the 8th column on the first line (7 + 1 = 8. 0 + 1 = 1). I believe the position you'd want to specify would be (5,0) for the 6th column on the first line. Again, great video and thanks again.
@rdagger7 жыл бұрын
Great catch! I think you’re the first to notice this mistake. Thanks for the feedback.
@erkkinyfors89719 жыл бұрын
why i better off without grounding, if i ground it to the pi i have all light illuminated makes it very difficult to see
@rdagger9 жыл бұрын
+erkki nyfors If you are referring to grounding the contrast pin then you probably need a resistor or a potentiometer to adjust the contrast. My latest video on an international weather clock goes into detail about pots: kzbin.info/www/bejne/ap3Cn6aElrKeq7M
@Nāmarūpa110 ай бұрын
I had success with this tonight using fivdi/lcd node driver. I found I had to add 10ms sleep after each print, but I'm trying to find a better way using the provided callback but doing successive prints.
@barryburketv7 жыл бұрын
I have the pins connected to the gpio pins however i cant get this working at all. When i run either, i can get is get 2 lines of white boxes. Originally, before i run the test lcd file i have one line. by running it , i get 2 . Ive tried rewring it several times. Any suggestions on what GPIO pins may be the issue? Using pins 11(rw) 9(e) 10 22 21 17(4-7) on old model b
@rdagger7 жыл бұрын
First I would double check that all your connections to the LCD display have good solder joints. Next I would try adjusting the brightness and contrast using resistors or potentiometers. There is more info on my site.
@LeeRyuuji10 жыл бұрын
Great! I have learned many things from this video (comments on the code confuses me). Can you please make another video on LCDs but with inputs and what methods are used (for example, a calculator-like program using the LCD screen).
@rdagger10 жыл бұрын
I created a 2nd video for this series that demonstrates using inputs with an LCD Display. I use a hex calculator for the example: kzbin.info/www/bejne/l2nSq5malLyXY9k
@silversisask23288 жыл бұрын
Very clear and good tutorial. Could you make a tutorial of a raspberry Pi Bluetooth soundboard? Playback activated by a Bluetooth remote or smart device (phone, smartwatch) or possibly a Bluetooth keyboard.
@Synthematix2 жыл бұрын
I have this 16x2 rgb adafruit LCD display, when i connect it to LCDSMARTIE i can only get characters to show up on the left side of the screen, everything seems to be setup correctly with the MATRIX.DLL in smartie and the screens driver is installed (the com port driver) this has got me baffled
@JohnBerkPhx8 жыл бұрын
Very nice. Love the great Video Quality !! Perfect graphics. Lots of Useful information. Thanks!
@ErdosainNueve5 жыл бұрын
Hi. I want to use the Adafruit library, but my lcd display is 2004a. And with a backpack PCF8574t, how can i change the pins in Adafruit library to match the mine?? Thanks (i dont speak english)
@rdagger5 жыл бұрын
I have a tutorial on the PCF8574: kzbin.info/www/bejne/n2akZnSpebeFrbM
@-Squiggles-5 ай бұрын
Will the "adafruit-circuitpython-charlcd" python library work with the Raspberry pi 5, with the new GPIO differences and everything?
@rdagger5 ай бұрын
According to Adafruit's website: "CircuitPython libraries and adafruit-blinka will work on any Raspberry Pi board! That means the original 1, the Pi 2, Pi 3, Pi 4, Pi 5, Pi Zero, Pi Zero 2 W, or even the compute modules."
@-Squiggles-5 ай бұрын
@@rdagger Awesome! I'm about to solder on the headers and set up the wiring so I'll see if it works, fingers crossed. Also, its really cool that your still responding to comments on a nine year old video. It's really helpful because between the new and outdated information, it's really hard to find clear instructions and information as someone who is just starting off with this type of thing.
@jjffreeland13268 жыл бұрын
Using the test script to initiate lcd..py on a raspberry PI 3 failed to display output. import time and added a time.sleep(0.5) after each call and it displayed the messages.
@mementorequiem6 жыл бұрын
I was going crazy wondering why it didn't work for me - triple checked all the wiring and made sure there were no typos in my code, but all to no avail... that was until I cared to check the comments section. Needless to say you are a real (mental) life saver :) Thank you so much!
@ken-ntuee Жыл бұрын
I found that it's set_cursor() method in the updated Adafruit CharLCD library instead of setCursor() method as you update in your website today (2023.4.23)
@rdagger Жыл бұрын
Thanks for reporting the error! I updated the code on my site. Please note that the Adafruit CharLCD library is now deprecated and has been replaced by CircuitPython.
@JuryDutySummons3 жыл бұрын
Thanks, I got my display working. :) This was helpful.
@BretWrightSTUFF5 жыл бұрын
I am currently running Octoprint from an RPi to control my 3D printer. GPIOs are free, I can run this extract program to monitor Enclosure temperature and IP address etc correct?
@rdagger5 жыл бұрын
I'm note sure about the OctoPi image, but it should work.
@akashk51177 жыл бұрын
hello, thanks for your tutorial. what should i do if i want to display a variable’s content on the 16×2 lcd? like for example i have a string stored in variable f. so how would i proceed to print contents of f? since you showed the displaying of user entered data. help would be much appreciated.
@rdagger7 жыл бұрын
Format is probably the best approach. I have many examples on my website. For example: # Display IP address lcd.message('IP {}'.format(ip)) # Display power usage lcd.message(' {0:0.1f} Watts'.format(p/1000)) # Display pressure lcd.message(" {0:0.0f} psi {1:0.1f} bar".format(psi, bar)) # Display time lcd.message(datetime.now().strftime('%I:%M %p %b %d')) # Display temperature an humidity lcd.message(" {0:0.1f}".format(t)) lcd.write8(223, True) lcd.message("F {0:0.1f}%".format(h)) # Display number of motion detections lcd.message('Motion Detected {0}'.format(counter))
@adamobrien58929 жыл бұрын
Hi, i don't know what happening. I got it working before using this video and the adafruit library. But today it just isnt working. i re downloaded and did it all and it still runs stuff such as lcd.message() without saying theres a problem but no text will appear on the display?
@PixelPickaxe9 жыл бұрын
You should move this question to a forum.
@kenstovall72166 жыл бұрын
I just installed one of the temp probes on my Pi and was looking for some code or software that will allow me to display my temp in f on the front of my Monitor or even have it email me if it drops or get above a certain deg. I have found some very plan code but again was looking for something that would really stand out. Thank you and your videos are very nicely done !
@jakebroekhuizen97117 жыл бұрын
Hi, When I run the lcd.lcd_init(), the screen doesn't initialise? Any idea why?
@rdagger7 жыл бұрын
The most common culprit is wiring. Also check your gpio numbering. Is the backlight coming on? If the backlight or contrast is not set correctly, sometimes it's hard to see if it's working.
@krzysztofpiechota15549 жыл бұрын
Hello when i use "sudo ./Adafruit_CharLCD_IPclock_example.py" on display i can see some japan signs and some another signs. What can i do to fix it? (Sorry for my english)
@rdagger9 жыл бұрын
+Krzysztof Piechota Double check your wiring and that the GPIO pins you used match the ones specified in the Adafruit_CharLCD.py __init__. Make sure you don't have any other programs also using those GPIO pins. Do you get the same characters each time or are they random?
@krzysztofpiechota15549 жыл бұрын
I repare it, file lcd.py was wrong
@fahimferdous72939 жыл бұрын
if i want to use a tv via HDMI cable then what will be the code? if i add a motion sensor in this and a 55 inch led TV via HDMI cable. a certain video loop will be playback all the time. Then if someone cross the sensor, another video will be played. after that the first video will playback in a loop! thanks in advance!
@redpark28459 жыл бұрын
I do not have built in gpio pins on my display, but i dont want to solder (and i dont know how), can i just put my jumper wires through the 1-16 holes in my display directly to the gound and power and what not? thanks for your help.
@rdagger9 жыл бұрын
That is not going to be reliable. You're going to have to get a display with pins or you'll have to learn how to solder. There are a lot of good videos on soldering on KZbin and it is easy.
@redpark28459 жыл бұрын
+rdagger68 thanks for the quick response! I just messaged my dad and found out he knew how to solder so he will help me with that. Thanks for the great video!
@redpark28459 жыл бұрын
So I followed the instructions on your website after successfully hooking up my display, when I run the "sudo ./Adafruit_CharLCD_IPclock_example.py" command (with wifi dongle set to wlan0) it gives me an error saying "...import RPi.GPIO as GPIO...This module can only be run on a raspberry pi 2!" what can i do to fix this? thanks
@rdagger9 жыл бұрын
+RedPark Are you using a Pi2? What version of Rasbian are you running? Did you try a _sudo apt-get update_ followed by a _sudo apt-get upgrade_?
@redpark28459 жыл бұрын
+rdagger68 Raspberry Pi2 model b, Raspbian Wheezy, I didn't do an update didn't think about that. I will try that, thanks.
@ursulakinixx86418 жыл бұрын
do you know how to make that the lcd displays shows the time?
@rdagger8 жыл бұрын
My weather clock video demonstrates how to show the time on an LCD Display: kzbin.info/www/bejne/ap3Cn6aElrKeq7M
@simon51438 жыл бұрын
I wonder if its possible to make a custom PCB to instantly wire up the hardware. It would save up some time when tinkering with different hardware, such when I would like to use a hat or the display.
@rdagger8 жыл бұрын
Adafruit has an LCD display plate for the older Pi’s (Eagle schematic and board on Github.) You could use it as a template to create a DIY version for the newer Pi’s. You could make or buy an I2c LCD display breakout. They only require 4 wires (2 for power and 2 for I2C). I have a Raspberry Pi I2C LCD display tutorial: www.rototron.info/using-an-i2c-lcd-display-with-a-raspberry-pi/ Another option would be to buy a USB LCD display which is as easy as just plugging in a USB cable. I have another video on using USB LCD displays on the Pi with LCDProc: www.rototron.info/lcdproc-tutorial-for-raspberry-pi/
@IDecaturX9 жыл бұрын
okay so i got it all working but how do i put the gksu idle into coding so i can actually use the code, if i use the code i used on the part involving gksu it comes up with no module named Adafruit_CharLCD.(new to raspberry pi & python)
@rdagger9 жыл бұрын
+vSxScopeZz "no module" error would indicate the Adafruit library is not in your system path. In your python code, you can use the sys.path.append method to add the location of the Adafruit library to your path. There is an example on my website.
@aditid55139 жыл бұрын
I tried the first method ,but instead of characters some symbols are displaying. Im using Rpi b+ and YJHD 162A 16*2 LCD.What to do?
@rdagger9 жыл бұрын
Sounds like wiring, but there could be several causes. First double check your wiring and your datasheet. Make sure R/W is connected to ground and that RS, Enable and D4-D7 are connected to the GPIO pins you specified in LCD.py. Next I would try the Adafruit library to see if different software works better.
@freeflaminginfinite9178 жыл бұрын
Nicely done mate! You just scored another subscriber.
@marcusjackman14875 жыл бұрын
Would it be possible to hook up more than one of these LCD displays to your Raspberry Pi and control them separately from your Pi? I have a project that would require 4 of these LCD displays displaying separate information and data, but I really don't want to have to buy 4 raspberry pi's to accomplish this.
@rdagger5 жыл бұрын
Yes you can daisy chain multiple LCD displays using I2C. You can buy I2C LCD displays or your can convert an LCD display to I2C. I have an I2C LCD display tutorial: kzbin.info/www/bejne/n2akZnSpebeFrbM
@satheeshsam17 жыл бұрын
Hi i dont have programming background. How do you open lcd.py at 5:14 mark when you edit the GPIO pins. what window is that i dont recognize it. thanks
@rdagger7 жыл бұрын
I’m using Idle which is a very simple IDE that comes bundled with Python.
@satheeshsam17 жыл бұрын
Thanks. one last query as I have struggled to execute import DHT22 command using the pigpio method. I have DHT22.py in the same folder as pigpio and still says no file found. Adafruit method worked fine.
@rdagger7 жыл бұрын
First, you no longer need to install the pigpio library because it comes pre-installed with the latest version of Raspbian Jessie. The unzipped DHT22.py file should be placed in the same folder as your program. Also make sure you start the pigpio daemon before running your program. Please check out my website for more notes and updates: www.rototron.info/dht22-tutorial-for-raspberry-pi/
@satheeshsam17 жыл бұрын
when i use the method of calling DHT22 as per video (also below) i have no issues. but I still have trouble displaying temp/RH on the lcd. I did have DHT22.py in the PIGPIO folder and i have error when i use import DHT22.py as it says no DHT22.py found import os os.chdir('pigpio_dht22') import pigpio pi = pigpio.pi() import DHT22 s=DHT22.sensor(pi,4) s.trigger() print('{:3.2f}'.format(s.humidity() / 1.)) print('{:3.2f}'.format(s.temperature() / 1.)) s.cancel() s=DHT22.sensor(pi,4,17) s.trigger() s.cancel() pi.stop()
@rdagger7 жыл бұрын
You do not need to use _os.chdir_. Instead put the DHT22.py file in the same folder as your program. Also please make sure you unzip the file. I have an example on my website showing how to display DHT22 data on an LCD display using the Adafruit library: www.rototron.info/dht22-tutorial-for-raspberry-pi/#lcd
@LucaPR08 жыл бұрын
New problem - I am using an updated version of this module that takes inputs of lcd.lcd_string(message, line). however, no matter what argument I pass for the line, the text still appears on the first line! I tried using the commands used in this video to get it to appear on the second line but it didnt work. Let me know if there is a solution!
@rdagger8 жыл бұрын
Are you referring to Matt's 20x4 LCD display code? What size LCD display are you using?
@LucaPR08 жыл бұрын
+rdagger68 thanks for the reply! Yes this is with regards to Matt's code. I figured this one out too - I was using 1 and 2 for line numbers, whereas the code called for the LCD's RAM numbers 0x80 and 0xC0 for lines 1 and 2 respectively. Hopefully that helps anyone else having this problem
@jimmiealeksic43599 жыл бұрын
Hello! Is there any c++ library instead of Python?
Also at 7:26 when i type "lcd.lcd_string("Raspberry Pi", 2)" it says "TypeError: lcd_string() takes exactly 1 argumant (2 given)"?
@rdagger10 жыл бұрын
Sounds like you have the old code. Matt has a newer version: www.raspberrypi-spy.co.uk/2012/08/16x2-lcd-module-control-with-backlight-switch/
@sethgandy13378 жыл бұрын
Great and clean tutorial. So here's my problem. I own a Raspberry pi 3. I've done the wiring as shown and added in the dimmer pot. When plugged in, the LCD (sparkfun 16x2) displays the usual solid block of display. I cannot do the idle command, as I'm only ssh'ing in. So I am running under root. I installed all the python bits as shown, downloaded the lcd.py file and made the changes you made. When I fire up python, I can execute all the commands without error, just kind of takes them, but when I get to the init() script, the screen does not clear? Is there something I'm doing wrong?
@rdagger8 жыл бұрын
If you're using the latest version of Raspbian Jessie, you no longer need superuser privileges to access the GPIO. Double check your wiring and that the GPIO pins used match the GPIO pins specified in the code. Also try the Adafruit library to help determine if it is a software or hardware issue.
@sethgandy13378 жыл бұрын
Doubled checked the wiring, all sound. Tried the Adafruit library as well. No dice. Remembered I had an extra lcd module from my 3d printer. My 16x2 lcd was dead. Must have blown it before I added the potentiometer. I'm in business now, with a 20x4 lcd! :D Again, thanks for the video and help!
@bishop52497 жыл бұрын
can i do this to my old calculator screen? (fx 991ES PLUS 4)
@rdagger7 жыл бұрын
That specific calculator probably uses a graphic LCD instead of a character LCD display. Depending on the chipset you still might be able to reuse it. I have a separate video on graphic LCD displays: kzbin.info/www/bejne/hJ-Ypmyuna12iq8
@vashishtpanday30203 жыл бұрын
Hello! Please let me know as soon as possible
@rdagger3 жыл бұрын
The command should be GPIO.setmode(GPIO.BOARD) instead of GPIO.setmode(BOARD) You can use either BCM or BOARD mode. I just tested both and they work. If you use BOARD then you have to confirm you have the correct pin numbers for your specific Raspberry Pi.
@krzysztofgawryluk45019 жыл бұрын
Yeah. This is what I was lookin for. Good job
@Unknown-vk9bh10 жыл бұрын
Help please im stuck at 7:13 when i enter "lcd.lcd_init" it says "Runtime error: No access to /dev/mem. Try running as root !" however how can run as root because sudo dont work?
@rdagger10 жыл бұрын
In order to use GPIO, you need superuser privileges. Take a look at 4:58 where from a terminal window, I use: /usr/bin/gksu -u root idle
@Unknown-vk9bh10 жыл бұрын
rdagger68 oh lol i guess i must have skipped that part
@jamespond14238 жыл бұрын
Hi! Thanks for a great tutorial! I have small problem though. When I typed lcd.clear() all the 32 'squares' turned white. I tried to message the lcd and I could barely see the text when I looked at the screen from an angle. But all the 'squares' remained white. Do you know how to fix this?
@rdagger8 жыл бұрын
Sounds like the contrast. You need to use a resistor or variable resistor. Check out my website and other videos for instructions.
@jamespond14238 жыл бұрын
Everything works now! Thanks again!
@DebanjanKarmakar3 жыл бұрын
Adafruit Library is not working now. It raises runtime error as "RuntimeError: Could not determine platform." can you please do an updated video regarding this library.
@rdagger3 жыл бұрын
Did you check my website because I posted several updates since the video came out in 2014?
@DebanjanKarmakar3 жыл бұрын
@@rdagger yes but it still showing that same error message..please help
@rdagger3 жыл бұрын
@@DebanjanKarmakar The old Adafruit library used in the video is deprecated and probably is unable to recognize your newer Raspberry Pi. Please see my website for an example of using the newer Adafruit library: www.rototron.info/lcd-display-tutorial-for-raspberry-pi/#cp
@cahau83939 жыл бұрын
if the panel is not displaying anything but i am pretty sure there is no error to the connection and code? what could be the reason behind??
@rdagger9 жыл бұрын
+CA Hau The most common problems are the backlight or the contrast. Check the datasheet and make sure you have the proper voltage and resistor, if necessary, for the backlight. Grounding the contrast pin should provide maximum contrast. Next double check that you specified the correct GPIO numbers when you initialized the display and confirm the datasheet pinout. Some displays have different placements for D4-D7. Also make sure you have an LED backlight. Some displays are electroluminescent which are harder to set up. Often you can still see text with the backlight off if you look very carefully at the right angle. Finally try a different library (Adafruit or Raspberry Pi Spy) to confirm it's not software. Also see my website for more info (link in description above).
@cahau83939 жыл бұрын
+rdagger68 thankyou for the prompt reply, i realised that i did some mistake to the declaration for RS and E, it should be gpio pin num not the pin num of the pi
@PAOLAHERNANDEZ-kv1mu9 жыл бұрын
good an error when compiling your code , at line 59, 181, 98 .. someone help me urgent 'm using the raspberry pi .. 2 Model B appears to be me ??
@akashk51177 жыл бұрын
hey, the lcd.py package worked for me. but i have a doubt how to clear the lcd screen using the lcd.py software package? if suppose i wnt to set a timer of 3 secnds and then i want to clear the lcd after 3 secs. what should i do? please help :)
@rdagger7 жыл бұрын
There is no built-in clear command, but you can use lcd_byte: sleep(3) lcd.lcd_byte(0x01, lcd.LCD_CMD) sleep(.05) This is from memory (not tested). I added a .05 second pause to ensure the command completes (not sure if it is necessary.)
@akashk51177 жыл бұрын
alright.. i got it working.. thanks for replying man... and once again thanks for the tutorial.. :)
@MSDGurukul6 жыл бұрын
nice tutorial sir.I followed each step from above video.make connections as it is. I used adafruit library for LCD Display.after power on raspberry Pi ,back light of 2x16 LCD is activated and getting 16 black boxes on display screen. But unable to show any string on display. please help
@rdagger6 жыл бұрын
You may need to adjust the contrast. Please check my website for more information.
@MSDGurukul6 жыл бұрын
i tried with potentiometer to adjust contrast,and with this now I am able to adjust contrast.But still not showing any string character on LCD display.
@rdagger6 жыл бұрын
Did you try both libraries (Adafruit & Raspberry Pi Spy)? Make sure you specified the correct GPIO pins. Make sure you distinguish between board and BCM pins.
@MSDGurukul6 жыл бұрын
finally sir ,it works. I used Adafruit library.I rechecked all connections.thank you for such nice tutorial .
@yashadattsawant23807 жыл бұрын
can i do this? if particular mobile comes in wi-fi network then lcd screen should show the message
@rdagger7 жыл бұрын
Yes, you could do an ARP scan for MAC addresses. Or if you have a Wi-Fi dongle that supports monitor mode in Raspbian, you could create a Wi-Fi sniffer. There is a Python library called Scapy that would probably work. If you are trying to detect your own phone then I would take a look at Google’s proximity beacons.
@fabiothoma81499 жыл бұрын
Hey, i've got a problem: If I type into the shell "os.chdir('/home/pi/lcd')" , the error "Traceback (...) File "" line 1, in os.chdir('/home/pi/lcd') OSError: [Errno 20] Not a directory: '/home/pi/lcd' is on the Display. What can i do? sry for my english :P I'm german
@rdagger9 жыл бұрын
+Run Boy Do you have a folder named lcd in your pi folder? You don't need chdir or path.append if the lcd.py module is in the same folder as your python program.
@fabiothoma81499 жыл бұрын
+rdagger68 okay thanks for your tip. I will try it tomorrow :)
@fabiothoma81499 жыл бұрын
+rdagger68 So now that problem is fixed. If i type now "import lcd" the error "Traceback (...) File "" line 1, in import lcd File "lcd.py", line 46 lcd_byte(DISPLAY_LINE1, DISPLAY_CMD) TabError: inconsistent use of tabs and spaces in indentation" is on the display. what should i do? drive.google.com/file/d/0B8mEx9kAwCR7alhXODdqeTdsZXM/view?usp=sharing --> ERROR PIC
@rdagger9 жыл бұрын
+Run Boy Python is very strict when it comes to the indentations. You should not use tabs. You should use spaces and they should be a consistent number (4 spaces per indentation is preferred). The author of lcd.py used 2 spaces for indentation so you should also use 2 spaces when you edit this file. In Idle, you can use Format -> Untabify Region to fix mixed tabs in the code. Just makes sure you set the columns per tab to the same number of spaces currently used in the program.
@justinwhistine81629 жыл бұрын
Could you please tell me what brand this LCD happens to be or could you please provide a link as to where you purchased it? I would really appreciate it.
@rdagger9 жыл бұрын
+Justin Whistine There's a link on the bottom of my temperature monitor project: www.rototron.info/projects/pi-temperature-monitor/
@ogbananaswag33309 жыл бұрын
I typed in os.chdir('/home/pi/lcd') and I received a message saying that no such file was found. Can anyone help me figure out this issue?
@rdagger9 жыл бұрын
OG BananaSwag Did you create a folder in your home directory called lcd? The command is case sensitive, so make sure you didn't spell it LCD. When in doubt you can use the file manager to find the folder and then copy the path from the address bar.
@ogbananaswag33309 жыл бұрын
rdagger68 THANK YOU SO MUCH lol i appreciate it
@barryblack14118 жыл бұрын
I have completed the above project and have it working fine, my only problem is that the IP for my PI displayed is in the new longer format. Is there a conversion that can be done to put in the old format which will fit my 2x16 character display? Thanks in advance.
@rdagger8 жыл бұрын
If you're using the code from the video, you need to make sure that you specify the correct interface: eth0 for wired or wlan0 for wi-fi. Another approach would be to _import socket_ and use: print([(s.connect(('8.8.8.8', 53)), s.getsockname()[0], s.close()) for s in [socket.socket(socket.AF_INET, socket.SOCK_DGRAM)]][0][1])
@barryblack14118 жыл бұрын
I am using the Adafruit CharIP.py and the interface is setup for eth0, ethernet connection. The issue is that although the time and date display properly, the IP address is not the 'old' 192.168. ?.? but starts off with fe80::3fb3:d20e: etc. I am something of a beginner and so the rest of your reply regarding 'socket',I don't really understand.
@barryblack14118 жыл бұрын
I now see that I was expecting to get the IPV4 address but received the IPV6 instead.
@rdagger8 жыл бұрын
Add the top of your program add _import socket_ Then use the command above to print the IPV4 address. You can change print to lcd.message to send to the display instead.
@barryblack14118 жыл бұрын
I did as you suggested and got the following error which I don't understand: Traceback (most recent call last): File "ipv4.py", line 23, in lcd.message([(s.connect(('8.8.8.8',53)),s.getsockname(),s.close()) for s in [socket.socket(socket.AF_INET,socket.SOCK_DGRAM)]][0][1]) File "/home/pi/CharLCD.py", line 205, in message self.write4bits(ord(char), True) TypeError: ord() expected a character, but string of length 12 found
@rabiihlioui93158 жыл бұрын
Excuse me , i did as you did exactly but in the end of wiring , i started by connecting the VCC of the PI to the VCC of the breadboard , the LCD display goes on but when i connect the ground to the ground , it goes off so i disconnected the ground it goes on again , i didn't know why , can you help me ?
@rdagger8 жыл бұрын
+Manzeliano tunisino What type of display are you using? Are you using and external power supply? I would double check your wiring. Make sure the pinout of your LCD matches the one in the video.
@rabiihlioui93158 жыл бұрын
i was using pi 2 configurations when i'm using pi 1 , sorry, all good now but now i don't where do i put the tow python files so i can control the display, please help
@rdagger8 жыл бұрын
+Manzeliano tunisino You can put the lcd.py library in the same folder as your program or add it to the path. The Adafruit library has breaking changes since the video. You now use pip to install it and it automatically gets added to the path. See my website for more info.
@rabiihlioui93158 жыл бұрын
+rdagger68 , my prof said i should use c++ , another problem , but i didn't find any code to configure the gpio between the lcd and the RPi ,do you have any code in c++ that can help me ? just one more help please
@rdagger8 жыл бұрын
+Manzeliano tunisino There are 2 very good GPIO libraries for the Pi that support C++: wiringpi.com/ and abyz.co.uk/rpi/pigpio/
@progressivewholesomeness49375 жыл бұрын
Is it possible to set up a 16×2 lcd And a 3.5" in capacitive touch screen as you monitor?
@rdagger5 жыл бұрын
You can use a DSI or HDMI touch screen for your monitor and a 16x2 LCD to display text.
@explosivemosfet13763 жыл бұрын
So are RPi pins 5V tollerant...i expected 3.3V isn't enough to drive LCD I/O to an high level and 5v of LCD output to destroy RPi
@rdagger3 жыл бұрын
The RPi pins are NOT 5 V tolerant. You can damage the Pi if you connect the GPIO pins to 5V. See 2:30 in the video. The LCD HD44780 data lines operate satisfactorily at 3.3 V.
@explosivemosfet13763 жыл бұрын
@@rdagger I knew that HD44780 if you operate at 5V Vih min is 0.7*Vcc >3.6. But i will read the datasheet again, maybe i remember wrong
@Sli3py6 жыл бұрын
hi, I have followed your tutorial but I fail both methods with to initial the LCD, with the first method I got error "Traceback (most recent call last): File "", line 1, in File "/home/pi/lcd.py", line 14 import RPi.GPIO as GPIO import time" then I cannot call LCD in the interpreter, and with the second one (the Adafruit) I can not find the where I have to change the pin number. =( i am so sorry I'm very noob with electrical engineering and Raspberry Pi but I'm trying to learn, Thanks you so much for your answer in advance.
@rdagger6 жыл бұрын
You can't have 2 import statements on the same line which is what it looks like, but I'd need to see the full error message to better troubleshoot. For the Adafruit library, you specify the pins when you instantiate the LCD. For example: lcd = Adafruit_CharLCD(rs=26, en=19, d4=13, d5=6, d6=5, d7=11, cols=16, lines=2) There have been breaking changes since I posted this video 3 years ago. Please check out my website for updates: www.rototron.info/lcd-display-tutorial-for-raspberry-pi/
@sojisoji60689 жыл бұрын
Hey.can you help me? when i type "import lcd" into the shell i get this: "" Traceback (most recent call last): File "", line 1, in import lcd File "lcd.py", line 27, in GPIO.output(LCD_LED, TRUE) RuntimeError: No access to /dev/mem. Try running as root! "" can you help me fix this? beginner here :)
@sojisoji60689 жыл бұрын
+Soji Soji i used raspberry pi B
@rdagger9 жыл бұрын
+Soji Soji You need super user access anytime you work with the GPIO pins on the Pi. Use sudo or gksu to open your python editor. For example to open Idle: /usr/bin/gksu -u root idle
@mayaankkumbhar7205 жыл бұрын
I am getting error in console. ImportError: No module named lcd when I execute import lcd in python console Any answer on how it is to be done
@rdagger5 жыл бұрын
Please see my website for updated installation instructions for the Adafruit LCD library.
@AritroKar8 жыл бұрын
Hi! Awesome tutorial. I tried doing it through the first method. It worked, but I cannot see the text when I looking straight at it. I can see it from another weird angle, but not straight. I wired everything as showed. Behind the text is a dark rectangle of pixels. I don't know why that is coming. I'm a newbie to Raspberry Pi. Please help.Thanks!
@rdagger8 жыл бұрын
You need to adjust the contrast and the brightness. Please take a look at my website for more information. My international weather clock video also goes into more details about using variable resistors to control contrast and brightness.
@AritroKar8 жыл бұрын
I fixed it. Thanks a lot!
@morpsox8 жыл бұрын
yo man, please help. ive been working on a project using a 2004A 20x4 LCD module. everything works great. except when i build my code the display gets initialized, then imediatly locks up. now heres the wierd part. if i disconnect the 5v power from pin 2 that powers the display it 1. stays on and 2. unfreezes the code and works fine other than a slight decrease in contrast. when you reconect pin 2 to 5v power the contrast corrects and it freezes once again. if i ground pin 2 it will reset the display and need to be re-inicialized. i have two of these displays and both do the same thing. however i have a third display with the same pinout and it works as you would expect.
@morpsox8 жыл бұрын
+Scarry Garry sorry about spelling
@rdagger8 жыл бұрын
+Scarry Garry Hard to tell without looking at it. Sounds like incorrect wiring or poor connections. I would examine the solder connections for the pin header and check for shorts. I like to use a magnifying glass and/or take high resolution pictures. If 1 of the 3 displays works then it's not software assuming the displays are identical.
@morpsox8 жыл бұрын
rdagger68 i thought u might say tht. I have checked the wires thoroughly several times. Its on a bread board so one might think tht wld b the issue, its been doing this very consistantly. My only other thought is to change my initialization code slightly. Thanks for the help
@morpsox8 жыл бұрын
+Scarry Garry new info. i think it might be my LCDbusy code. for whatever reason it is getting stuck in my do while loop. code below. i commented it out and it wrote all the characters, in a jumbled order but it didnt get stuck. dont know if showing some of my code helps but here you go. unsigned char LCDBusy(void) { unsigned char y; TRISD = 255; PORTEbits.RE0=0; PORTEbits.RE2=1; do { PORTEbits.RE1=1; y=PORTD; PORTEbits.RE1=0; clockpulse(); }while(PORTDbits.RD7==1); PORTEbits.RE2=0; TRISD = 0; return(y); }
@rdagger8 жыл бұрын
+Scarry Garry Your code doesn't look like it's for the Pi. What type of SBC or SoC are you using? Are you writing the LCD library from scratch?
@JesusGamayon7 жыл бұрын
Thank you for this video, my friend, this is very useful. More power to you!
@lualgomo3920 Жыл бұрын
Can't init no matter what. Get a row of blocks in the first line and nothing else. Any help?
@rdagger Жыл бұрын
A single illuminated row sounds like a wiring issue. Double check all your connections and keep them as short as possible. One possible culprit is that the read/write pin is not properly grounded. You might need to add resistors or a pot for the contrast and/or the backlight but I don’t think that would affect only 1 row. Also make sure your display uses an HD44780 driver chip.
@michaelpukmel91758 жыл бұрын
Thank you for making and posting this video. Do you mind if I ask: I read some documentation that says the Raspberry Pi voltage rail and logic is 3.3v. I bought a 16x2 display that says it requires 5v. Does this mean it needs 5v for both power and logic?
@barryblack14118 жыл бұрын
The RaspberryPI has both 5V and 3.3V output pins available.
@michaelpukmel91758 жыл бұрын
Thanks Barry.
@LucaPR08 жыл бұрын
I have followed all your steps exactly (or so I think) and when I enter the lcd.lcd_init() command, nothing happens on the lcd. Also no error message!! super frustrating!! any help would be appreciated ASAP! (i know it is a very vague issue but I have no idea how to fix it)
@LucaPR08 жыл бұрын
SOLVED! was a soldering issue! thanks for the vid!
@lakritzz77778 жыл бұрын
What was your problem exactly? I have same situation that you discribe in your comment, but i dont find any issues :-/
@LucaPR08 жыл бұрын
+La Kritzz all of my connection were not soldered properly. Once I soldered everything it worked fine. If you message me I tho i can send you my email and i could take a look at your code
@markuskosters43018 жыл бұрын
You said that it is somehow possible to use less pins on the Pi. Have you got an instruction for that too? Because I haven't got that much pins left
@rdagger8 жыл бұрын
Yes, please see my video on Using an I2C LCD display: kzbin.info/www/bejne/n2akZnSpebeFrbM More info is available too on my website: www.rototron.info/using-an-i2c-lcd-display-with-a-raspberry-pi/
@TrickyWu8 жыл бұрын
Okey, could you help me shortly? :) I just did everythin' you've said in this vid. except of the updated stuff on your website. But now, after all configuration, it just doesen't show what i said by typing: >>> lcd.lcd_string("hi", 2) Got an Idea why? :/
@rdagger8 жыл бұрын
Double check your wiring which is the most common problem. Check all your solder connections. Check the GPIO pins you selected match the GPIO pins in the code. Also look very closely at the display because it could be a contrast or LED back light issue. After these steps I would try both python libraries (lcd.py and Adafruit) to make sure it’s not a software issue. Please use the updated instructions on my website.
@TrickyWu8 жыл бұрын
Okey, just recognised that i've to use some of the GPIO's a second time. This isn't possible i guess... otherwise, if i'd connect a l2d Display, would it work... thx, for your help.
@jimlagraff49898 жыл бұрын
Just subscribed and love all the projects you've done. Ive had an Adafruit 16 x 2 LCD with backpack (LCD) for 2 weeks and still haven't managed to send any text to it in python. I know it's a very specific question but have you ever done an example of anything this basic on one of these backpack LCDs?
@jimlagraff49898 жыл бұрын
Thank you so much for the response, I'm going to run through that example tonight. Once again, great tutorials!
@jannetjdayette19426 жыл бұрын
how to read the values of the voltage generator and display on lcd using raspberry pi and python ??
@rdagger6 жыл бұрын
I have a video on using an INA219 to read and display voltage and current on an LCD display: kzbin.info/www/bejne/eJi2mXZ6bN2HlaM
@danielvidal71639 жыл бұрын
What should I do to pharse JSON from a website and display it on the LCD display?
@rdagger9 жыл бұрын
+Daniel Vidal That is a broad question. It depends on the website. There are several python libraries for JSON but I have not worked with them. My server room temperature monitor project discusses using SUDS which is a lightweight SOAP client for consuming web services: www.rototron.info/projects/pi-temperature-monitor/ The LCD display does not care about the source. You just need to convert the JSON to a string and send it to the LCD.
@danielvidal71639 жыл бұрын
rdagger68 Do you think you can make a video on this?
@rdagger9 жыл бұрын
+Daniel Vidal I created an International Weather Clock tutorial that demonstrates how to parse JSON forecast data and display it on an LCD display: kzbin.info/www/bejne/ap3Cn6aElrKeq7M
@jimbelmore77567 жыл бұрын
thank you for your time and your knowledge. I have now been able to get a lcd1602 basically functioning. I am unable to get the adafruit_charlcd or ipclock_examples working. i have performed chmod +x but when I run sudo ./Adafruit_CharLCD_IPclock_example.py I get unable to execute.....no such filename or directory. I am trying to get through all your tutorials and I don't know if I was supposed to assume something and chmod something else or if its a result of how I obtained the files. adafruit has modified the repository and so those files are in a legacy tree so when you do a git clone what you get cloned is not the original directory but a readme file that tells you about the move they made and a link to page that tells you how to install something via pip. anyway I'm all over the board and I think this should be much more straightforward based on you video. I've looked at your website but it just reiterates the same info and I need to find out where I'm missing something. Thank you
@rdagger7 жыл бұрын
I updated the IP clock program to work with the latest version of the Adafruit Char_LCD library: www.rototron.info/lcd-display-tutorial-for-raspberry-pi#ipclock
@user-it6jd1sb6k10 жыл бұрын
Thanks. Because of this video I have to buy such a display. What a cool toy...
@InnovativePanda8 жыл бұрын
Hi, Great video. Got my LCD display successfully powered up. However, when I send a message using either of the python libraries, no message is shown on the LCD display. Any idea why?
@rdagger8 жыл бұрын
I would check the contrast and the brightness. If you look at some of my other videos or my website I demonstrate how to use potentiometers to adjust them.
@logancantin68388 жыл бұрын
Hello! Thank you for making this video, it has been super helpful. My LCD is working almost perfectly. The one problem I have is that when I look at the display straight on, I can not distinguish the letters, but when I move up and look at it from above, I can see the letters. Can anyone help me out?
@rdagger8 жыл бұрын
+Logan Cantin It's probably a brightness or contrast issue. I have more info on my website. Also my weather clock video demonstrates using pots to control contrast and brightness.
@logancantin68388 жыл бұрын
+rdagger68 Ok, I'll check that out. Thanks!
@yashwanthchityala79673 жыл бұрын
thanks buddy
@Codebyakshay Жыл бұрын
Hey i have 20x4 will it works the same way u mentioned above ?
@rdagger Жыл бұрын
It should. You will need to specify a column width of 20 instead of 16.
@Havanacuba19858 жыл бұрын
Very good , I must watch it a few times though haha, thank you for your hard work
@nikyabodigital6 жыл бұрын
Why do I type commands on Terminal instead of in the Python application itself. Please answer me.
@rdagger6 жыл бұрын
I am typing all the python commands into the IDLE shell which is a great learning tool for python because of its interactivity. IDLE is a simple IDE that comes bundled with most python distributions.
@hunsetter0618 жыл бұрын
I get the error: bash: cd: Adafruit _CharLCD No such file or directory. Help
@rdagger8 жыл бұрын
The Adafruit library install instructions have changed since the video was released. Did you use pip install? For updated instructions see my website (link in the description).
@sunnydays12387 жыл бұрын
Hi, I have tried this but get the error "Please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)" does anyone know what i need to do?
@rdagger7 жыл бұрын
Super-user privileges are no longer required for GPIO access with the latest version of Raspbian. GKSU is not recommended any more and has been removed from Raspbian distributions.
@markeasterling65177 жыл бұрын
This was really helpful! Thank you.
@dayrudehd88767 жыл бұрын
Nice vid, i have a question though.. i am really new to hardware and wanted to ask that what are those super short black and red cables named?
@rdagger7 жыл бұрын
They're called pre-formed jumper wires. They're sold in kits of assorted colors and length. You can also make them yourself using 22 gauge solid wire.
@artlessroger1973 жыл бұрын
do you need a bread board? can you not do it by directly connecting the pi to an lcd screen?
@artlessroger1973 жыл бұрын
like for an example to display and animate a name like for a name tag
@rdagger3 жыл бұрын
You can connect the LCD directly.
@artlessroger1973 жыл бұрын
@@rdagger awesome.
@hindhujak97446 жыл бұрын
Nice video I tried it but whenever I try to clone the adafruit library it throws a error msg that couldn't resolve the host GitHub.com What to do now!??
@rdagger6 жыл бұрын
The video is 4 years old. Please see my website for updates such as using pip to install the Adafruit library.
@boston_rob9 жыл бұрын
@7:13 I get a run time error for line 117 "please set pin numbering mode using GPIO.setmode(GPIO.BOARD) or GPIO.setmode(GPIO.BCM)" did anyone else run into this and fix it? I've been trying to figure it out but can't yet.
@rdagger9 жыл бұрын
Rob Nordberg Sounds like you skipped some of the initialization code. Look at the code that I cut and paste at 5:50 in the video.
@boston_rob9 жыл бұрын
rdagger68 That didn't fix it :(
@rdagger9 жыл бұрын
Rob Nordberg Did you trying downloading the code from my website: www.rototron.info?
@timb16489 жыл бұрын
Thanks for the video! I tried this on my Raspberry Pi 2 Model B 1GB and did not have the same results. When I did the Init, my display went to solid digits on all digits, both lines. What version of the Pi are you running? I tried with both of the code examples you provided and got the same result. I did a bit of searching and some other people are having similar results as I am.
@rdagger9 жыл бұрын
+Tim Boonstra I've run the code on several Pi versions including the 2B. Sounds like it might be a contrast/brightness issue. Did you try both libraries (Adafruit & lcd.py)?
@timb16489 жыл бұрын
+rdagger68 Ya, I did try both.... I might have a contrast issue. That would be great if that is all it is. I will try and tone that down and see if that helps. Is that just a resistor on pin 3?
@rdagger9 жыл бұрын
+Tim Boonstra Ground is full contrast. Increase voltage to lower contrast. There is more info on my website at the bottom of the project page. See description for link.
@VirajPawarguynexdoor9 жыл бұрын
I'm getting an error.OSError: No such file or directory: 'home/pi/lcd'
@rdagger9 жыл бұрын
+Viraj Pawar Create a directory called lcd in your home/pi folder and copy the lcd.py file into it. Make sure you put a slash before home. Example: sys.path.append('/home/pi/lcd')
@karthikmedia4u3 жыл бұрын
How to display that for large display
@reedl17678 жыл бұрын
Do you only have to use resistors on the backlight part of the display? Anyone can answer, thanks ahead of time.
@rdagger8 жыл бұрын
The control and data lines don't need resistors. You can use resistors or variable resistors on the contrast pin and the back light anode pin to control contrast and brightness. My weather clock video has a demonstration of using variable resistors to control contrast and brightness: kzbin.info/www/bejne/ap3Cn6aElrKeq7M The schematics and code for both videos are available on my website. Some LCD display backlights will require a resistor. Please check your LCD display datasheet.
@prateekchachra97585 жыл бұрын
Love this video! Thank you so much!
@SerbianTechGuy8 жыл бұрын
Hello, i am using raspberry pi 2 model B, and i 16x2 LCD module(display) with backlight.I have connected everything just like you but on my module there is no text.I have changed the code like you, used the same pins but nothing happens. Can you help me? Thanks in advance :)
@rdagger8 жыл бұрын
+Serbian Tech Guy Have you tried both libraries? Does the back light illuminate when you provide power?
@SerbianTechGuy8 жыл бұрын
+rdagger68 I am not using Adrafruit, i don't work over breadboard, i have solded the connectors for jumpers on lcd display and i conneted jumpers, display showed the light but the text is not appearing on lcd module
@rdagger8 жыл бұрын
+Serbian Tech Guy It's hard to troubleshoot just from your description. I would try the Adafruit library to rule out software. I recommend you check out my website for recent updates regarding the Adafruit library. I also suggest you double check all your wiring and use a magnifying glass to check all your solder connections. It could be a contrast issue. My recent email and weather station videos have more info on LCD displays and potentiometers to vary brightness and contrast: kzbin.info/www/bejne/opSzoaZsobp-bsU and kzbin.info/www/bejne/ap3Cn6aElrKeq7M
@SerbianTechGuy8 жыл бұрын
+rdagger68 Thank you very much, i just have started to learn how to do something on raspberry and that kind of stuff.Sorry if i am boring but, do i need Adrafruit for raspberry if i want to use Adrafruit library? Thanks a lot :)
@rdagger8 жыл бұрын
+Serbian Tech Guy Not sure I understand the question. You don't have to buy an Adafruit LCD display to use their library. The Adafruit LCD library works with most common LCD displays.
@laisa73895 жыл бұрын
uhm there is no such file or directory in /usr/bin/gksu -u root idle how do i fix this ?
@rdagger5 жыл бұрын
Super-user privileges are no longer required for GPIO access with the latest version of Raspbian. Therefore, GKSU is unnecessary. Also Thonny is now the default Python editor instead of Idle.
@aannleax8 жыл бұрын
Weirdly, my LCD starts printing nonsense, when I try to write a character, which character code either starts or ends with 1111 in binary. Any ideas?
@rdagger8 жыл бұрын
Which library are you using? Can you post your code (the line in question)?
@aannleax8 жыл бұрын
Thanks for the quick reply. I copied the code from here: www.tutorials-raspberrypi.de/wp-content/uploads/scripts/hd44780_test.py Basically looks like what you showed at 8:46. If I comment out the line "lcd_message("funktionieren :)")" everything works correctly (the 'o' is causing the problem it seams). Leaving it in there, the first row prints out only white squares (although you can barely see that it actually writes random symbols) while the second row keeps completely dark.
@rdagger8 жыл бұрын
It might be an encoding issue. What value do you get if you type ord('o')
@aannleax8 жыл бұрын
It's 111 which translates to 01101111 in binary. It appears to happen with every character who ends or starts with 1111.
@rdagger8 жыл бұрын
You could build a character map for your LCD with the following and see how it compares to the ord values: from time import sleep for i in range(33, 256): print(i) lcd_send_byte(i, LCD_CHR) sleep(1)
@volkerking575710 жыл бұрын
Hands up - Super Video Thank you!
@progameer19 жыл бұрын
help! my screen shows squares and no letters or numbres. i´ve rewired it a couple of times and im quite shure it´s ok. can anyone tell me why it doesn´t work???!?
@rdagger9 жыл бұрын
You may have to lower the contrast. Also double check that the pins you specified in the code match the GPIO pins.
@progameer19 жыл бұрын
hahah thank you, i already fixed it at night... the thing was that my soldering is not the best so i had to re solder all the connections. after that, the lcd worked fine (well... i still need a potenciometer for the contrast but i can barely see the letters
@manoramadarekar11556 жыл бұрын
how to use adafruit char lcd library to set backlight color as blue with 16 lcd pin out
@rdagger6 жыл бұрын
There's an example on the Adafruit GitHub repo: github.com/adafruit/Adafruit_Python_CharLCD/blob/master/examples/char_lcd_rgb.py
@manoramadarekar11556 жыл бұрын
ok.But in this program three extra pins are used : lcd_red = 4 lcd_green = 17 lcd_blue = 7 # Pin 7 is CE1 So I have Raspberry Pi 3 ,LCD with 16 header pins.I make circuit same as shown in your video.So I used total Pin no 1,2,3,4,5,6,11,12,13,14,15,16 of LCD.So now I am confused where to connect this 4 ,17,7 (physical pins 7,11,26) with LCD. plz guide me for connection.
@rdagger6 жыл бұрын
Sorry that example was for an RGB backlight. Try this one: github.com/adafruit/Adafruit_Python_CharLCD/blob/master/examples/char_lcd.py You would use one 1 extra GPIO pin to control the backlight. It would be best to use an NPN transistor. The GPIO pin would be connected to the base of an NPN transistor with a 10K ohm resistor in series. The backlight LED anode would be connected to 5V. The LED cathode would be connected to the NPN transistor collector. The transistor emitter would be connected to ground.