Skip to content
Version 2.x of Gordon Henderson's Arduino-like WiringPi GPIO functions, wrapped up for Ruby.
Branch: master
Clone or download
Type Name Latest commit message Commit time
Failed to load latest commit information.
ext/wiringpi Just in case Mar 12, 2016
lib ScrollPhat class Mar 12, 2016
.gitignore Ignored object files Mar 12, 2016
.gitmodules Ignored object files Mar 12, 2016
CHANGELOG Updated changelog Jul 10, 2012
COPYING Add explicit license to project Sep 30, 2013 Update and rename README to Oct 22, 2015
wiringpi.gemspec Bumped version to match wiringPi Mar 12, 2016


WiringPi is an implementation of most of the Arduino Wiring functions for the Raspberry Pi, this gem is a wrapper for the main wiringpi library and provides a nice OO interface with a few other handy helpers.


Install with gem install wiringpi2 or use bundler's Gemfile

source ''

gem 'wiringpi2' #

then: bundle install


#!/usr/bin/env ruby

require 'bundler'

io = do |gpio|
  gpio.pin_mode(0, WiringPi::OUTPUT)
  gpio.pin_mode(1, WiringPi::INPUT)

pin_state = io.digital_read(1) # Read from pin 1
puts pin_state

io.digital_write(0, WiringPi::HIGH) # Turn pin 0 on
io.delay(100)                       # Wait
io.digital_write(0, WiringPi::LOW)  # Turn pin 0 off

You will need to run your scripts as root because WiringPi accesses /dev/mem



For a complete run-down see the pins page of the wiringpi website. alt text alt text


Full details on the wiringpi website.

You can’t perform that action at this time.