Setting up RPi.GPIO with OpenELEC

S

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.

About the author

By Jamie

My Books