Last active
August 29, 2015 14:08
-
-
Save juliancheal/ff030c57a98ff59d4d4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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