Drivers

Artoo has a extensible system for connecting to hardware devices.

Wii Classic Controller


Allows user to use a Nintendo Wii Classic Controller via i2c interface

How To Connect

For Arduino:

require 'artoo'
connection :arduino, :adaptor => :firmata, :port => '127.0.0.1:8023'
device :wiiclassic, :driver => :wiiclassic, :connection :arduino

For Digispark:

require 'artoo'
connection :digispark, :adaptor => :littlewire, :vendor => 0x1781, :product => 0x0c9f
device :wiiclassic, :driver => :wiiclassic, :connection :digispark

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 wiiclassic, :a_button => proc { puts "a button pressed!" }

Example using a Nintendo Wii Classic Controller comming soon.

require 'artoo'

connection :arduino, :adaptor => :firmata, :port => "127.0.0.1:8023"
device :wiiclassic, :driver => :wiiclassic, :connection => :arduino, :interval => 0.1

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

Events

start_driver

Starts the driver

a_button

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

b_button

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

x_button

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

y_button

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

home_button

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

select_button

Get's triggered every interval amount of time if the select button (-) is pressed.

start_button

Get's triggered every interval amount of time if the start button (+) is pressed.

right_trigger

Get's triggered every interval amount of time if the right trigger button is pressed, makes right trigger value available.

left_trigger

Get's triggered every interval amount of time if the left trigger button is pressed, makes left trigger value available.

left_joystick

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

right_joystick

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

Circuit

Coming soon...

Compatibility