Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ext libraries #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions README → README.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
# WiringPi-Ruby

WiringPi: An implementation of most of the Arduino Wiring
functions for the Raspberry Pi

WiringPiGem: The WiringPi library wrapped up for Ruby with some OO goodness, sanity checking and other handy additions.

WiringPi GPIO:
## WiringPi GPIO:

require 'wiringpi'
io = WiringPi::GPIO.new
io.write(pin,value)
io.read(pin,value)

Shift out:
### Shift out:

io.write(latch_pin, LOW)
io.shiftOut(data_pin, clock_pin, LSBFIRST or MSBFIRST, value)
Expand All @@ -20,15 +22,15 @@ WiringPi GPIO:

io.shiftOutArray(data_pin, clock_pin, latch_pin, [0,1,0,0,1,1,1,0])

WiringPi GPIO with /sys/class/gpio:
## WiringPi GPIO with /sys/class/gpio:

require 'wiringpi
require 'wiringpi'
io = WiringPi::GPIO.new(WPI_MODE_SYS)
# read/write/shift as usual

WiringPi Serial:
## WiringPi Serial:

require 'wiringpi'
require 'wiringpi'
s = WiringPi::Serial.new('/dev/ttyAMA0',9600)
s.serialPuts('Hello world!')
s.serialClose
Expand Down
1 change: 1 addition & 0 deletions ext/wiringpi/extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
$objs = $srcs.map{ |file| file.sub('.c','.o') }
$srcs << 'wiringpi_wrap.c'
$objs << 'wiringpi_wrap.o'
$libs << '-lwiringPi'

create_makefile('wiringpi/wiringpi')

Empty file added lib/wiringpi/.keep
Empty file.
4 changes: 2 additions & 2 deletions wiringpi.gemspec
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
Gem::Specification.new do |s|
s.name = 'wiringpi'
s.version = '1.1.0'
s.version = '1.1.1'
s.license = 'GNU General Public License'
s.date = '2012-06-22'
s.platform= Gem::Platform::RUBY
s.summary = "Arduino wiring-like library for Raspberry Pi GPIO. Will only work on a Pi. Alpha version."
s.authors = ["Gordon","Phil"]
s.email = '[email protected]'
s.files = Dir.glob('lib/*.rb') + Dir.glob('ext/**/**/*.{c,h}') + Dir.glob('ext/**/*.{c,h,rb}')
s.files = Dir.glob('lib/*.rb') + Dir.glob('lib/wiringpi/.keep') + Dir.glob('ext/**/**/*.{c,h}') + Dir.glob('ext/**/*.{c,h,rb}')
s.homepage = 'http://rubygems.org/gems/wiringpi'
s.extensions = ['ext/wiringpi/extconf.rb']
s.description = 'WiringPi library wrapper for the Raspberry Pi only. Wraps up the Arduino wiring-like WiringPi library into a convinient Ruby gem. Currently includes GPIO functionality, serial and shiftOut/shiftIn support. Credit to Gordon for the WiringPi library, which can be found here: http://projects.drogon.net/raspberry-pi/wiringpi/'
Expand Down