Created
September 18, 2015 13:54
-
-
Save scalone/6ecc497ecb257f19b8dc 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 :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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment