Drivers

Artoo has a extensible system for connecting to hardware devices.

Makey Button


Inspired by the awesome MakeyMakey (http://makeymakey.com), this GPIO driver allows you to connect a 10 MOhm resistor to a digital pin on your Arduino or Raspberry Pi to control your robots with bananas, clay, or drawable circuitry.

How To Connect

For Arduino:

require 'artoo'
connection :arduino, :adaptor => :firmata, :port => '127.0.0.1:8023'
device :button, :driver => :makey_button, :pin => 2

How To Use

require 'artoo'

connection :arduino, adaptor: :firmata, port: '127.0.0.1:8023'
device :led, driver: :led, pin: 13
device :button, driver: :makey_button, pin: 2

work do
  puts "Press the button connected on pin #{ button.pin }..."

  on button, :push    => proc { led.on }
  on button, :release => proc { led.off }
end

Commands

is_pressed?

Returns true or false matching state of the button.

Params

no params

Returns

Returns true or false

Events

start_driver

Starts the driver.

:push

This event gets triggered when the button changes state from released to pushed.

:release

This event gets triggered when the button changes state from pushed to released.

Circuit

Compatibility