Platforms

Artoo has a extensible system for connecting to hardware devices.

Arduino


Repository Issues

Arduino is an open-source electronics prototyping platform based on flexible, easy-to-use hardware and software. It's intended for artists, designers, hobbyists and anyone interested in creating interactive objects or environments.

+ info about the Arduino platform, click here

How To Install

Install the Artoo module providing Arduino support through RubyGems:

$ gem install artoo-arduino

How To Use

This small program lets you push a button on the arduino board to turn a LED on or off.

In less than 10 lines of code using Artoo.

require 'artoo'

connection :arduino, adaptor: :firmata, port: '/dev/ttyACM0'

device :led, driver: :led, pin: 13
device :button, driver: :button, pin: 2, interval: 0.01

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

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

How To Connect

OSX

The main steps are:

  • Install the artoo-arduino gem
  • Find out what serialport your arduino is connected to
  • Upload the Firmata protocol sketch to the arduino
  • Connect to the device via Artoo

First plug the Arduino into your computer via the USB/serial port. A dialog box will appear telling you that a new network interface has been detected. Click "Network Preferences…", and when it opens, simply click "Apply".

Install the artoo-arduino gem:

$ gem install artoo-arduino

Once plugged in, use Gort´s scan command to find out your connection info and serial port address:

$ gort scan serial

Use the gort firmata install command to install avrdude, this will allow us to upload firmata to the arduino:

$ gort arduino install

Once the avrdude uploader is installed, we can upload the Firmata protocol to the Arduino. Use the serialport address we found with the earlier gort, or leave it blank to use the default address (/dev/ttyACM0).

$ gort arduino upload /dev/ttyACM0

Finally, change the connection to the correct serial port.

connection :arduino, adaptor: :firmata, port: '/dev/[your_serial_port]'

Ubuntu

The main steps are:

  • Install the artoo-arduino gem
  • Find out what serial port your arduino is connected to
  • Upload the Firmata protocol to the arduino
  • Connect to the device via Artoo

First plug the Arduino into your computer via the USB/serial port.

Install the artoo-arduino gem:

$ gem install artoo-arduino

Once plugged in, use Gort´s scan command to find out your connection info and serial port address:

$ gort scan serial

Use the gort firmata install command to install avrdude, this will allow us to upload firmata to the arduino:

$ gort arduino install

Once the avrdude uploader is installed, we can upload the Firmata protocol to the Arduino. Use the serialport address we found with the earlier gort, or leave it blank to use the default address (/dev/ttyACM0).

$ gort arduino upload /dev/ttyACM0

Finally, change the connection to the correct serial port.

  :::ruby
  connection :arduino, adaptor: :firmata, port: '/dev/[your_serial_port]'

Windows

We are currently working with the Celluloid team to add Windows support. Please check back soon!

Drivers

Thanks to the Firmata protocol, it's possible to interact with a number of hardware devices connected to the Arduino.

Artoo's flexible syntax also makes it simple to then swap the Arduino platform for another, such as the Beaglebone Black or Digispark, and use the same code.

Available drivers for the arduino platform are listed below, the drivers contain detailed documentation and examples of what kind physical computing (using artoo and ruby) you could be doing:

GPIO Drivers

I2C Drivers