Sha256: f3a58cf5698ef21725054c8f3a0dd775bf26ba6af75d9ead471d367efbb3e18d

Contents?: true

Size: 552 Bytes

Versions: 5

Compression:

Stored size: 552 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 => 0, :interval => 0.5
device :board, :driver => :device_info

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

5 entries across 5 versions & 1 rubygems

Version Path
artoo-arduino-1.4.2 examples/maxbotix.rb
artoo-arduino-1.4.1 examples/maxbotix.rb
artoo-arduino-1.4.0 examples/maxbotix.rb
artoo-arduino-1.3.0 examples/maxbotix.rb
artoo-arduino-1.2.0 examples/maxbotix.rb