1 Reply Latest reply on Nov 4, 2014 10:00 AM by zking

    Wiring-x86 Python library for Edison GPIOs now available

    David_J_Hunt

      Hi all,

       

      There’s now a new version of Wiring-x86 which now supports Edison’s GPIOs. It’s at https://github.com/emutex/wiring-x86

      It was previously available for Galileo and Galileo Gen2, but we've just added Edison support.

       

      Wiring-x86 is a Python library that uses an API similar to WiringPi to let you easily talk to the GPIO pins on the Arduino header.

      It hides all that complicated multiplexing we detailed in the recent article we published on EmutexLabs behind nice Python wrappers.

       

      So, to turn on the on-board LED:

      from wiringx86 import GPIOEdison as GPIO

      gpio = GPIO(debug=False)

      gpio.pinMode(13, gpio.OUTPUT)

      gpio.digitalWrite(13, gpio.HIGH)

       

      There are several ways mentioned to get it, and here's another handy one:

       

      wget http://github.com/emutex/wiring-x86/archive/master.tar.gz

       

      Also, you can set the debug parameter to True, and it will output all the sysfs accesses the library performs to do all the mixing, inputs, outputs, etc. Beware, however, that it initialises all 13 pins to a safe config when it starts, so there will be lots of lines output before it gets to your pinMode calls. Still, it's very handy for generating shell scripts to do particular tasks.

       

      Enjoy,

      Dave.