Setting up RPi.GPIO with OpenELEC Setting up RPi.GPIO with OpenELEC

I bought a Raspberry Pi a while ago and setup OpenELEC so I could use it as a media library. Just recently I decided I wanted to have some fun with the GPIO on the Pi.

The examples all looked quite simple when it was assumed the RPi.GPIO was already installed. However, with OpenELEC being a media center first and an OS second, it was a little more involved.

I did end up getting it working and here is how I did it:

1. Install the OpenELEC unofficial addons repository.

2. Once installed, add the RPi.GPIO package from the Tools section.

3. In your Python code, before importing, include the directory where the RPi.GPIO is installed:

import sys

sys.path.append('/storage/.kodi/addons/python.RPi.GPIO/lib/')

4. Follow one of the many great tutorials from Raspberry Pi.

Published on Dec 7, 2015

Tags: Python | Raspberry Pi | python | rpi.gpio | raspberry pi

Related Posts

Did you enjoy this article? If you did here are some more articles that I thought you will enjoy as they are very similar to the article that you just finished reading.

Tutorials

Learn how to code in HTML, CSS, JavaScript, Python, Ruby, PHP, Java, C#, SQL, and more.

No matter the programming language you're looking to learn, I've hopefully compiled an incredible set of tutorials for you to learn; whether you are beginner or an expert, there is something for everyone to learn. Each topic I go in-depth and provide many examples throughout. I can't wait for you to dig in and improve your skillset with any of the tutorials below.