Drivers

Artoo has a extensible system for connecting to hardware devices.

Wii Nunchuk


Allows user to use a Nintendo Wii Nunchuck controller via i2c interface

How To Connect

For Arduino:

require 'artoo'
connection :arduino, :adaptor => :firmata, :port => '/dev/ttyACM0'
device :wiichuck, :driver => :wiichuck, :connection :arduino

How To Use

How to use events and call them on your drivers

Pretty simple, when the connection and the driver have been setup (as explained above) you can call events on them as follows:

on wiichuck, :c_button => proc { puts "c button pressed!" }

Example using a Nintendo Wii Nunchuck.

require 'artoo'

connection :arduino, :adaptor => :firmata, :port => '127.0.0.1:8023'
device :wiichuck, :driver => :wiichuck, :connection => :arduino, :interval => 0.1

work do
  on wiichuck, :c_button => proc { puts "c button pressed!" }
  on wiichuck, :z_button => proc { puts "z button pressed!" }
  on wiichuck, :joystick => proc { |*value|
    puts "joystick x: " + value[1][:x] + ", y: " + value[1][:y]
  }
end

 Events

start_driver

Starts the driver

c_button

Get's triggered every interval amount of time if the square button is pressed.

z_button

Get's triggered every interval amount of time if the square button is pressed.

joystick

Get's triggered every "interval" amount of time if a joystick event occured, you can access values x, y.

Circuit

Coming soon...

Compatibility