WiringPi Serial And Shiftout
Gordon strikes again, releasing a new WiringPi which not only includes the ShiftOut functions I was attempting to add, but also a whole delightful library of Serial goodness.
I've rolled both of these things into a new version of the WiringPi gem, which has also undergone some significant architectural changes favouring a more Object Orientated design. I've incremented the major version to reflect this.
To use GPIO functions you should create an instance of the WiringPi::GPIO class:
pin = 1
io = WiringPi::GPIO.new
And to use Serial functions, use the Serial class:
s = WiringPi::Serial.new('/dev/ttyAMA0',9600)
I've also wrapped up GPIO.shiftOut with an handy, more Ruby-friendly function shiftOutArray. This takes an array of 1s and 0s and shifts them out as bytes automatically.
Full source for WiringPi-Ruby is available on GitHub and I've pushed up Gordon's WiringPi library itself for those interested in contributing to the code.