Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cubie_pin

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cubie_pin

  • 0.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

CubiePin

Control GPIO pins on a CubieBoard 2 running Cubian.

This is a work in progress and may contain bugs and incomplete features.

For a list of the pins you can use visit the GPIO Introduction page of the Cubian wiki.

Installation

If you do not have Ruby you can install 1.9.3 on Cubian by running:

sudo apt-get update
sudo apt-get install ruby ruby-dev

Add this line to your application's Gemfile:

gem 'cubie_pin'

And then execute:

$ bundle

Or install it yourself as:

$ gem install cubie_pin

Usage

To enable a pin for output:

# :pin and :direction are required, an exception will be raised if they are not
# passed

# Pin 61 is physical pin 48 on the side of the board with the SATA port
pin = CubiePin::Pin.new(:pin => 61, :direction => :out)

Modify the value:

# on and off will raise an exception if called on an input pin
pin.on # Turns the pin on and caches the value as 1
pin.off # Turns the pin off and caches the value as 0

Read the current value of the pin:

pin.read # Reads the value from the pin and caches it
pin.value # Returns the cached value of the pin
pin.on? # Returns true if the cached value is 1, false otherwise
pin.off? # Returns true if the cached value is 0, false otherwise

Contributing

  1. Fork it ( https://github.com/[my-github-username]/cubie_pin/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

FAQs

Package last updated on 28 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc