Shard Detail

tinkerforge v0.2.0

Crystal bindings and easy-to-use wrapper classes for TinkerForge components.

Install & Use

Add the following code to your project's shard.yml under:

dependencies to use in production
- OR -
development_dependencies to use in development


tinkerforge:
  github: feritarou/tinkerforge

Readme

Tinkerforge

Bindings and easy-to-use wrapper classes to make Crystal code interact with TinkerForge components.

Installation

  1. Add the dependency to your shard.yml:

    dependencies:
      tinkerforge:
        github: mathalaxy/tinkerforge
        branch: master
    
  2. Run shards install

Usage

require "tinkerforge"

staple = TF::Staple.new
staple.connect ip_address: "localhost", port: 4223

if staple.connected?
  staple.devices.each do |dev|
    case dev
    when TF::MasterBrick
      puts "Master of the universe!"
    when TF::RotaryPotiBricklet
      puts "Rotary Poti shows #{dev.position}"
    end
  end
end

Development

Currently, there is only support for a very limited set of TF components, because these are what I use in other projects. Supported bricks/bricklets are:

If you would like to add support for other components, please feel free to contribute!

Contributing

  1. Fork it (https://github.com/mathalaxy/tinkerforge/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

Contributors

Docs

GitHub release

Build Status