Sha256: d2578f5ac696f234a50f21e264f19f3113f7416113482022a8cd3b2a076fed9c

Contents?: true

Size: 504 Bytes

Versions: 7

Compression:

Stored size: 504 Bytes

Contents

require 'artoo/adaptors/adaptor'

module Artoo
  module Adaptors
    class Firmata < Adaptor
      attr_reader :firmata

      def connect
        require 'firmata' unless defined?(::Firmata)
        @firmata = ::Firmata::Board.new(connect_to)
        @firmata.connect
        super
        return true
      end

      def disconnect
        super
      end     

      def method_missing(method_name, *arguments, &block)
        firmata.send(method_name, *arguments, &block)
      end
   end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
artoo-0.4.0 lib/artoo/adaptors/firmata.rb
artoo-0.3.0 lib/artoo/adaptors/firmata.rb
artoo-0.2.0 lib/artoo/adaptors/firmata.rb
artoo-0.1.3 lib/artoo/adaptors/firmata.rb
artoo-0.1.2 lib/artoo/adaptors/firmata.rb
artoo-0.1.1 lib/artoo/adaptors/firmata.rb
artoo-0.1.0 lib/artoo/adaptors/firmata.rb