Project

pi_facer

0.0
No commit activity in last 3 years
No release in over 3 years
Event driven Raspberry Pi Piface library based on pi_piper lib
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

Overview

Pi Facer brings event driven programming to the Raspberry Pi's PiFace accessory.
Pi Facer was designed for Ruby 2.0! Pi Facer was based and inspired on Pi Piper and uses piface, and such is still alpha as piface is.

To get started:

To install Pi Facer:

sudo gem install pi_facer

PIFACE

PiFace Digital plugs directly onto the top of your Raspberry Pi, and allows you to sense and control the real world. 2 Changeover relays 8 Open-collector outputs 8 Digital inputs 8 LED indicators 4 Switches Graphical emulator and simulator

require 'pi_facer'
include PiFacer

watch :io => 3 do
  puts "FIO changed from #{last_value} to #{value}"
end

PiFacer.wait

Your block will be called when a change to the pin's state is detected.

Additionally you can use the outputs too:

pin = PiFacer::FIO.new(:io => 1, :direction => :out)
pin.on
sleep 1
pin.off

Proudly developed exclusively on a Raspberry Pi