Skip to content

Instantly share code, notes, and snippets.

@juliancheal
Last active August 29, 2015 14:08
Show Gist options
  • Save juliancheal/ff030c57a98ff59d4d4f to your computer and use it in GitHub Desktop.
Save juliancheal/ff030c57a98ff59d4d4f to your computer and use it in GitHub Desktop.
require 'artoo'
connection :firmata, :adaptor => :firmata, :port => '/dev/cu.usbmodem1411'
device :board, :driver => :device_info
device :relay_1, :driver => :relay, :invert => true, :pin => 7
device :relay_2, :driver => :relay, :invert => true, :pin => 8
work do
puts "Firmware name: #{board.firmware_name}"
puts "Firmata version: #{board.version}"
# every 5.second do
# puts "Relay OFF"
puts "Turning Relay 1 OFF"
relay_1.off
# end
#
# every 10.second do
# puts "Relay ON"
# relay.on
# end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment