Giter VIP home page Giter VIP logo

wiringpi-ruby's Introduction

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:

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

    Shift out:

    io.write(latch_pin, LOW)
    io.shiftOut(data_pin, clock_pin, LSBFIRST or MSBFIRST, value)
    io.write(latch_pin, HIGH)

    Shift out an array of 1/0s (always uses LSBFIRST):

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

WiringPi GPIO with /sys/class/gpio:

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

WiringPi Serial:

require 'wiringpi'
    s = WiringPi::Serial.new('/dev/ttyAMA0',9600)
    s.serialPuts('Hello world!')
    s.serialClose

Full details at:
	https://projects.drogon.net/raspberry-pi/wiringpi/

wiringpi-ruby's People

Contributors

gadgetoid avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.