LCD display and buttons in Python (tutorial and code)

Raspberry Pi related support

Re: LCD display and buttons in Python (tutorial and code)

Postby Peter » 25 Jul 2015, 04:21

User avatar
Peter
 
Posts: 64
Joined: 06 Mar 2014, 23:32

Re: LCD display and buttons in Python (tutorial and code)

Postby XploD » 26 Jul 2015, 23:02

Hi,

I'm pretty new at this as well, I just have some kind of background since I'm an engineering student but before RuneAudio, I never tried Arch Linux and also I never wrote anything more than "Hello World" in Python. Also, this year I started working with Raspberry Pi and using GPIO for the first time as well. I'll try to make it as easy as possible. Currently it's complicated because there are lots of dependencies for this to work. I should find a better way to include this directly to my program. For I2C, it's easier because I have a library directly included into program. You only have to install Python and to enable I2C and install required tools, I will write a tutorial once I finish.

Where are you getting stuck, on which step?
Music taste:
Audio source: Raspberry Pi 2 + Sabre ES9023 DAC + WD 500 GB HDD + TP-Link TL-WN722N Wi-Fi + D-LINK Dub H7 USB hub
Hi-Fi:
Mixer: Nady Audio MM-242
Misc: Tube Stereo Vumeter (Magic Eye)
User avatar
XploD
 
Posts: 77
Joined: 24 Mar 2015, 18:32
Location: Croatia

Re: LCD display and buttons in Python (tutorial and code)

Postby Peter » 05 Aug 2015, 08:06

Hi there, I eventually got it working!! I am not sure quite how, but it works. With a combination of a majority of @XploD's advice, a dose of @Hairybikers's process - and some experimentation with Arch commands - it works. Now I need to clone the SD card so I have a working copy, before I try to redo and streamline the installation so I can reinstall when the SD card needs reflashing.

Just as an aside...Should this thread perhaps be in the DIY section? Then others who want to implement this great idea can access it more easily than in the general thread.

And lastly... could the code be included in the Runeaudio gitpull/ .4 release?
User avatar
Peter
 
Posts: 64
Joined: 06 Mar 2014, 23:32

Re: LCD display and buttons in Python (tutorial and code)

Postby XploD » 05 Aug 2015, 08:59

Hello. I'm glad that you got it working :) About DIY section, sincerely, I haven't seen this section till now :mrgreen: Maybe you're right. And about including it in the release, I don't know. The code is pretty a mess. The new code, maybe, but dev team will decide.

I wrote a completely new code, which supports 4x20, 2x16 and both I2C and parallel displays and it's much better. But currently I have a lot of problems with network on my Pi2, seems that RuneAudio for Pi2 is a mess so I'm waiting for the dev team to fix this. The code is on github, if you want to take a look: https://github.com/RandyCupic/RuneAudioLCD
Music taste:
Audio source: Raspberry Pi 2 + Sabre ES9023 DAC + WD 500 GB HDD + TP-Link TL-WN722N Wi-Fi + D-LINK Dub H7 USB hub
Hi-Fi:
Mixer: Nady Audio MM-242
Misc: Tube Stereo Vumeter (Magic Eye)
User avatar
XploD
 
Posts: 77
Joined: 24 Mar 2015, 18:32
Location: Croatia

Re: LCD display and buttons in Python (tutorial and code)

Postby hondagx35 » 05 Aug 2015, 11:11

User avatar
hondagx35
 
Posts: 3042
Joined: 11 Sep 2014, 22:06
Location: Germany

Re: LCD display and buttons in Python (tutorial and code)

Postby jeroenrood » 06 Nov 2015, 14:52

Thank you XploD,
I've followed your instructions for the first display, and that went well. (A couple of months ago)
Now I've installed a I2C back-pack and installed your second version. With a 20x4 display this is much nicer!
The only problem was that the i2c-dev was not loading. I had to insert the module in /etc/modules-load.d/raspberrypi.conf .
After that, everything works fine,
so thank you for developing the software.
Jeroen.
jeroenrood
 
Posts: 15
Joined: 06 Nov 2015, 14:45

Re: LCD display and buttons in Python (tutorial and code)

Postby matock » 22 Nov 2015, 18:49

matock
 
Posts: 10
Joined: 22 Nov 2015, 18:43

Re: LCD display and buttons in Python (tutorial and code)

Postby matock » 24 Nov 2015, 11:38

matock
 
Posts: 10
Joined: 22 Nov 2015, 18:43

Re: LCD display and buttons in Python (tutorial and code)

Postby XploD » 24 Nov 2015, 13:51

Hello @matock, sorry for my late reply, I haven't visited this forum for a few days. I'm glad that you found a solution for your problem and that you got it working, and also thanks for your tutorial! You're right, the cause for your problems is probably the change of Adafruit library, but also, as far as I remember, this tutorial and code was written for Raspberry Pi model B (not RPi2) so there may be some differences as well.

As I already stated somewhere, now I use RPi2 and I don't use this code anymore, I wrote a new one, much better than this one, and you can find it on my GitHub: https://github.com/RandyCupic/RuneAudioLCD if you want to try. But currently it supports only I2C display, I haven't written a class for "normal" 4-wire displays yet. Also, it still needs some polishing so that's the reason I haven't written a tutorial for it yet. I'm planning to change I2C library because this one is pretty slow (visible when scrolling text), I'm planning to add a 4-wire display support and also I'll try to move to Redis client instead of MPD, because on this current code, Spotify won't work on LCD, only MPD (local files, radio and DLNA). Also Airplay doesn't work (it works but doesn't show on display, the same is for Spotify).
Music taste:
Audio source: Raspberry Pi 2 + Sabre ES9023 DAC + WD 500 GB HDD + TP-Link TL-WN722N Wi-Fi + D-LINK Dub H7 USB hub
Hi-Fi:
Mixer: Nady Audio MM-242
Misc: Tube Stereo Vumeter (Magic Eye)
User avatar
XploD
 
Posts: 77
Joined: 24 Mar 2015, 18:32
Location: Croatia

Re: LCD display and buttons in Python (tutorial and code)

Postby matock » 09 Dec 2015, 22:31

Hi XploD,

Thank you for your link. I will have a look when I have some time, by curiosity. My LCD is a normal "4 wire" and I would like to keep this solution. I tweaked a little bit your script and my LCD works fine now.

Thank you again for this work.
Matock
matock
 
Posts: 10
Joined: 22 Nov 2015, 18:43

support RuneAudio Donate with PayPal

PreviousNext

Return to Raspberry Pi

Who is online

Users browsing this forum: Bing [Bot] and 2 guests