Sha256: bb2d735c81a9f39a90ea311d50ad3e4599fb0da490acc704e89063614ecd8351

Contents?: true

Size: 1.23 KB

Versions: 1

Compression:

Stored size: 1.23 KB

Contents

# ffi-wiring-pi

[![Gem Version](https://badge.fury.io/rb/ffi-wiring_pi.svg)](https://badge.fury.io/rb/ffi-wiring_pi)[![Build Status](https://travis-ci.org/vimutter/ffi-wiring_pi.svg?branch=master)](https://travis-ci.org/vimutter/ffi-wiring_pi)

* [Source](https://github.com/vimutter/ffi-wiring_pi/)
* [Issues](https://github.com/vimutter/ffi-wiring_pi/issues)

## Description

Ruby FFI bindings for the [wiringPi](http://wiringpi.com) library.

## Features

* Can setup and work with GPIO

## Examples

Setup GPIO:

    require 'ffi/wiring_pi'

    # Will setup with wiringPi pin numbering scheme
    FFI::WiringPi::GPIO.setup
    FFI::WiringPi::GPIO.set_pin_mode(0, FFI::WiringPi::GPIO::OUTPUT)
    FFI::WiringPi::GPIO.write(0, true)
    # Or
    FFI::WiringPi::GPIO.up(0)
    # Or
    pin = FFI::WiringPi::GPIO.get(0)
    pin.up!

    # Or

    extend FFI::WiringPi::GPIO

    setup
    pin = get 0
    pin.up!

    pin2 = get 1, INPUT
    p pin2.value

## Requirements

* [Ruby](http://ruby-lang.org/) >= 2.6.1 or
* [wiringPi](http://wiringpi.com/download-and-install/) >= 2.46
* [ffi](http://github.com/ffi/ffi) ~> 1.0

## Install

    $ gem install ffi-wiring_pi

## License

Copyright (c) 2019 Mark Huk

See [Licence](LICENSE.txt) for license information.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ffi-wiring_pi-0.2.0 README.md