Sha256: 6e37596da3a2455fde2c974025f5962e56ca9a02b9fcb0e1d2149d667925300e

Contents?: true

Size: 547 Bytes

Versions: 1

Compression:

Stored size: 547 Bytes

Contents

require 'artoo'

# Circuit and schematic here: http://www.electrojoystick.com/tutorial/?page_id=285

#connection :firmata, :adaptor => :firmata, :port => '/dev/ttyACM0'
connection :firmata, :adaptor => :firmata, :port => '127.0.0.1:4567'
device :sonar, :driver => :maxbotix, :pin => 14, :interval => 0.5
device :board, :driver => :board

work do
  on sonar, :range => :sonar_reading

  puts "Firmware name: #{board.firmware_name}"
  puts "Firmata version: #{board.version}"
  puts "starting sonar..."
end

def sonar_reading(*args)
  puts args
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
artoo-arduino-1.1.0 examples/firmata_maxbotix.rb