tag:blogger.com,1999:blog-5009055240032393377.post2005138598977048856..comments2023-07-23T02:50:39.554-07:00Comments on tech2077's tech blog: Running a HD44780 LCD over I2C (On the Raspberry Pi)Anonymoushttp://www.blogger.com/profile/17169295842022207305noreply@blogger.comBlogger55125tag:blogger.com,1999:blog-5009055240032393377.post-57995108471723111882021-07-08T00:32:13.890-07:002021-07-08T00:32:13.890-07:00ok, good idea, it can help me
i like them
it is ve...ok, good idea, it can help me<br />i like them<br />it is very good<br /><a href="http://www.viewelcd.com" rel="nofollow">LCD Panel</a><br /><a href="http://www.viewelcd.com" rel="nofollow">LCD Module</a><br /><a href="http://www.viewelcd.com" rel="nofollow">LCD screen </a><br /><a href="http://www.arrows-hobby.net" rel="nofollow">Arrow Hobby</a><br /><a href="http://www.freewing-model.com" rel="nofollow">Freewing RC jet </a>520121488https://www.blogger.com/profile/09719120694700466153noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-2119853750772958222014-05-17T21:34:54.708-07:002014-05-17T21:34:54.708-07:00Man i just wanted to thank you for the code you pr...Man i just wanted to thank you for the code you provide here , it help me a lot to make work this lcd with my java app , now u show me the way , almost everythings work.<br /><br />your code is clear , clean and work perfectly, Good job !Anonymoushttps://www.blogger.com/profile/13753422818058281038noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-70426998748903710822013-12-22T16:15:24.656-08:002013-12-22T16:15:24.656-08:00Thanks a million for this. This took me so long t...Thanks a million for this. This took me so long to get going on my beaglebone black. I have an i2c lcd backpack that I bought from ebay that doesn't work with anything else, and I couldn't find easy code to modify to make it work properly. I went through probably 50 sites before I found your sample code. Justinhttps://www.blogger.com/profile/16057017459485675944noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-64027332529667965622013-12-14T19:09:17.500-08:002013-12-14T19:09:17.500-08:00The code above doesn't work. So I switched to ...The code above doesn't work. So I switched to http://www.recantha.co.uk/blog/?p=4849<br /><br />It loaded right away without error problem.Copied and pasted<br />working good I used indentation 4, using python 3.2.3<br />Btw, I don't used AdaFruit library,<br /><br />I'm very happy with recantha's blog. I suggest u try this recantha's site.<br /><br />suprahttps://www.blogger.com/profile/14226405646858172408noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-57491746977265088792013-12-14T04:04:19.083-08:002013-12-14T04:04:19.083-08:00Python_I2C is a library and test.py is main progra...Python_I2C is a library and test.py is main program to test it?<br />Did id u added import Python_I2C in test.py?suprahttps://www.blogger.com/profile/14226405646858172408noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-56747913795779522982013-12-14T03:07:01.036-08:002013-12-14T03:07:01.036-08:00Did u added import Hc44870.py to test.py?
I couldn...Did u added import Hc44870.py to test.py?<br />I couldn't find code from AdaFruitssuprahttps://www.blogger.com/profile/14226405646858172408noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-61313238414786431622013-12-13T11:31:06.174-08:002013-12-13T11:31:06.174-08:00supraDecember 11, 2013 at 7:44 PM
Thanks for resp...supraDecember 11, 2013 at 7:44 PM<br /><br />Thanks for responding! You said<br /><br />U missed something<br />self.lcd_device = i2c(addr, port)<br /><br />change to:<br />self.lcd_device = i2c_device(addr, port)<br /><br />I get the same error. I wo7uld really like to use Adafruit's I2C python code to use some of the other methods it has. I had changed the line as you saw as an attempt to make things work. The only other change I made was to delete the i2c_device lines. I had already loaded the Python_I2C module in my code.<br />JimJim Hodgershttps://www.blogger.com/profile/05846084430716396908noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-32329312052864900732013-12-11T19:44:21.602-08:002013-12-11T19:44:21.602-08:00U missed something
self.lcd_device = i2c(addr, por...U missed something<br />self.lcd_device = i2c(addr, port)<br /><br />change to:<br />self.lcd_device = i2c_device(addr, port)suprahttps://www.blogger.com/profile/14226405646858172408noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-68884890087072329862013-12-11T12:43:53.587-08:002013-12-11T12:43:53.587-08:00I deleted the I2c portion of the module because I ...I deleted the I2c portion of the module because I use Adafruit's Python_I2C module. The line " self.lcd_device = i2c_device(addr, port)" gives error <br />Traceback (most recent call last):<br /> File "test.py", line 5, in <br /> lcd=Hc44870.lcd(0x27,0)<br /> File "/home/root/Hc44870.py", line 31, in __init__<br /> self.lcd_device = i2c(addr, port)<br />NameError: global name 'i2c' is not defined<br /> I not sure what properly should be here.<br /><br />JimJim Hodgershttps://www.blogger.com/profile/05846084430716396908noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-55345698858145561852013-12-10T09:42:18.158-08:002013-12-10T09:42:18.158-08:00I don' know if ur code will work with IIC/I2C/...I don' know if ur code will work with IIC/I2C/TWI/SPI module with 20x4 lcd that i bought from ebay.suprahttps://www.blogger.com/profile/14226405646858172408noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-73514724627148636982013-12-10T09:36:56.310-08:002013-12-10T09:36:56.310-08:00Can this code will work that i bought from ebay? I...Can this code will work that i bought from ebay? It is IIC/I2C/TWI/SPI Serial Interface2004 20X4 Character LCD Module Display Blue<br /><br />Thanks!<br />suprahttps://www.blogger.com/profile/14226405646858172408noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-38740429279480541162013-11-14T16:58:57.852-08:002013-11-14T16:58:57.852-08:00I did the same using C programming. Anybody wants ...I did the same using C programming. Anybody wants to try it out? http://karunadheera.com/index.php/archives/194<br />You should however have Gordon's wiringPi - http://wiringpi.com/download-and-install/ first.Unknownhttps://www.blogger.com/profile/11790837930383365972noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-25321464056362703192013-09-06T00:23:28.544-07:002013-09-06T00:23:28.544-07:00Dear SPAMMER, the page cannot be found!Dear SPAMMER, the page cannot be found!PrO2xyhttps://www.blogger.com/profile/01211291004083181305noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-23794325531105304002013-05-09T12:39:20.644-07:002013-05-09T12:39:20.644-07:00I'll get it posted soon. I'm in the middle...I'll get it posted soon. I'm in the middle of a big overhaul of this, actually. I noticed that Matthew has this on Github, so I'll probably send him a pull-request once I have it working (and once I figure out how to *send* a pull request). Some improvements include:<br /> - Thread-safety (you can have multiple threads all sending stuff to the LCD and it won't cause problems with the signaling to the chip)<br /> - Backlight control<br /> - "Reverse" code is all moved to two methods which handle all of the moving around of the RS, Ena, R/W, Backlight, and data bits.<br /> - "Test" method which turns on each bit, one at a time, so that you can use a volt-meter to see which of your LCD pins each bit corresponds to. Then, you can figure out which "reverse" mode to use, or if you need to make your own.Anonymoushttps://www.blogger.com/profile/17559585922070303874noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-81103121547320738182013-05-02T12:10:48.493-07:002013-05-02T12:10:48.493-07:00Joe, can you post a working code of the custom cha...Joe, can you post a working code of the custom chars? every body look for it aorund the internet, did you have a full working code? please :(emuboyhttps://www.blogger.com/profile/01800899542839218659noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-33222614982956677802013-04-26T06:43:32.721-07:002013-04-26T06:43:32.721-07:00Man... I just can't stop tweaking. I've no...Man... I just can't stop tweaking. I've now added some thread-sync stuff so that you can now use this with multi-threaded code, and you don't have to worry about the i2c commands getting all interleaved. I'll stop posting code in the comments, because it's getting a little overboard. If you're interested in the code, let me know...Anonymoushttps://www.blogger.com/profile/17559585922070303874noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-79532921968559907712013-03-30T12:29:45.665-07:002013-03-30T12:29:45.665-07:00Okay... more fixes...
Turns out that the lcd_loa...Okay... more fixes...<br /><br />Turns out that the lcd_load_custom_chars() didn't work for me. It was calling self.lcd_device.write(0x40) when it *should* have been calling self.lcd_write(0x40) so that the command would be properly written in two half-byte nibbles:<br />____def lcd_load_custom_chars(self, fontdata):<br />#_______self.lcd_device.write(0x40);<br />________self.lcd_write(0x40);<br />________for char in fontdata:<br />____________for line in char:<br />________________self.lcd_write_char(line)<br /><br /><br />Also, while I was at it (because I was messing with custom chars so that I could make interesting logos), I needed to be able to place the cursor anywhere I wanted, so I wrote:<br /><br />row_offsets = [ 0x80, 0xC0, 0x94, 0xD4 ]<br />def lcd_locate_cursor(self, row=1, col=1):<br />____addr = self.row_offsets[row - 1] + col - 1<br />____self.lcd_write(addr)<br /><br />Now, in lcd_puts(), you can replace the:<br /><br />def lcd_puts(self, string, line):<br />____if line == 1:<br />________self.lcd_write(0x80)<br />____if line == 2:<br />________self.lcd_write(0xC0)<br />____if line == 3:<br />________self.lcd_write(0x94)<br />____if line == 4:<br />________self.lcd_write(0xD4)<br /> <br />____for char in string:<br />________self.lcd_putc(char)<br /><br />... with just ...<br /><br />def lcd_puts(self, string, line):<br />____self.lcd_locate_cursor(line)<br />____for char in string:<br />________self.lcd_putc(char)Anonymoushttps://www.blogger.com/profile/17559585922070303874noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-23514833749498736132013-03-26T19:41:45.634-07:002013-03-26T19:41:45.634-07:00I'll go and fix this on the gist, a nice addit...I'll go and fix this on the gist, a nice addition of elif to it should work. Thanks for the contribution.Anonymoushttps://www.blogger.com/profile/17169295842022207305noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-58810651561538204342013-03-26T11:19:49.218-07:002013-03-26T11:19:49.218-07:00Same problem exists in lcd_write_char(), incidenta...Same problem exists in lcd_write_char(), incidentally. Now my LCD works. Hooo boy! You should have *seen* the crazy stuff I was seeing with 2 sets of commands being sent to my LCD. :)Anonymoushttps://www.blogger.com/profile/17559585922070303874noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-6366823989526997932013-03-26T11:08:02.384-07:002013-03-26T11:08:02.384-07:00Thanks for this. You saved me a bunch of time. How...Thanks for this. You saved me a bunch of time. However, I think I found a bug. I've got a type of LCD/i2c config which you call "reverse == 1". When I use that, it sends two different strobe signals, because you have this (forgive the underscores... blogspot is stripping out my indenting spaces):<br /><br />def lcd_strobe(self):<br />__if self.reverse == 1:<br />____self.lcd_device.write((self.lcd_device.read() | 0x04))<br />____self.lcd_device.write((self.lcd_device.read() & 0xFB))<br />__if self.reverse == 2:<br />____self.lcd_device.write((self.lcd_device.read() | 0x01))<br />____self.lcd_device.write((self.lcd_device.read() & 0xFE))<br />__else:<br />____self.lcd_device.write((self.lcd_device.read() | 0x10))<br />____self.lcd_device.write((self.lcd_device.read() & 0xEF))<br /> <br />If reverse == 1, the first *AND* third blocks get executed because the third block is executed in the case that reverse != 2. What I added, on my end, was an else before the 2nd 'if'...<br /><br />def lcd_strobe(self):<br />__if self.reverse == 1:<br />____self.lcd_device.write((self.lcd_device.read() | 0x04))<br />____self.lcd_device.write((self.lcd_device.read() & 0xFB))<br />__else:<br />____if self.reverse == 2:<br />______self.lcd_device.write((self.lcd_device.read() | 0x01))<br />______self.lcd_device.write((self.lcd_device.read() & 0xFE))<br />____else:<br />______self.lcd_device.write((self.lcd_device.read() | 0x10))<br />_____self.lcd_device.write((self.lcd_device.read() & 0xEF))<br /><br />Works a little better. :) Of course, there's probably a way to do it with case statements, but I don't know any more about Python than I absolutely have to.Anonymoushttps://www.blogger.com/profile/17559585922070303874noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-42323369170764094172013-03-13T04:37:25.407-07:002013-03-13T04:37:25.407-07:00Thanx for ur post nd ur article, today I just tell...Thanx for ur post nd ur article, today I just tell u about a biggest retailar in electronics, ya <a href="http://www.sargam.in/Television" rel="nofollow">@Sargam Electronics</a> is the biggest Retail Chain in Electronics in Delhi. Sargam deals with big brands like Samsung, Sony, Lg, Toshiba, Sansui, Hitachi, Voltas, Godrej, Azure, Nikon, Whirlpool, Dell, HP, Acer and many more brands. <a href="http://www.sargam.in/Television" rel="nofollow">@Sargam Electronics</a> offers you to buy many electronics products like laptop,mobile,camera,washing machine,refrigerator,air conditionar and multiple electronics products at huge discount.Anonymoushttps://www.blogger.com/profile/00546739577329766894noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-38953542117421417682013-02-16T11:02:34.765-08:002013-02-16T11:02:34.765-08:00Hello.
All work fine, but how to use custom chara...Hello.<br /><br />All work fine, but how to use custom characters?<br />Thanks.Stevohttps://www.blogger.com/profile/06888627166961720023noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-77693194166567997342013-02-12T21:48:30.334-08:002013-02-12T21:48:30.334-08:00I can't use that futere because no one tryed i...I can't use that futere because no one tryed it and there is no example that can be found on the internet of it.<br />So my qoustion was if you have a code for us with a example of it.<br />Because there are symbols that for example can be used thats not in the standard symbol list of a HD44780 lcd.Anonymoushttps://www.blogger.com/profile/16981902860435678699noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-51619618462652596752013-02-12T21:29:43.537-08:002013-02-12T21:29:43.537-08:00It takes a 8x8 list of bytes that hold pixel data ...It takes a 8x8 list of bytes that hold pixel data for the char, this is an untested feature as I never had a need for it, but if it works for you great.Anonymoushttps://www.blogger.com/profile/17169295842022207305noreply@blogger.comtag:blogger.com,1999:blog-5009055240032393377.post-77216825810954513062013-02-12T21:24:33.832-08:002013-02-12T21:24:33.832-08:00Your script works fine but is it possible to tell ...Your script works fine but is it possible to tell us , how we can use own made characters?<br />The HD44780 lcd's can be programmed in CGRAM from 0 to 7.<br />In your code, if i read correct, you already have that part in it, but no where i can find a example for it! the code what i mean is.:<br /><br />/ add custom characters (0 - 7)<br />def lcd_load_custon_chars(self, fontdata):<br />self.lcd_device.bus.write(0x40);<br />for char in fontdata:<br />for line in char:<br />self.lcd_write_char(line)<br /><br />Best Regards.<br />Pascal.Anonymoushttps://www.blogger.com/profile/16981902860435678699noreply@blogger.com