Created
February 1, 2015 16:17
-
-
Save avermeulen/dd71099312277eb40614 to your computer and use it in GitHub Desktop.
Blinking an LED using ruby
This file contains hidden or 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/tty.usbmodem411' | |
#connection :firmata, :adaptor => :firmata, :port => '127.0.0.1:8023' | |
device :board, :driver => :device_info | |
device :led, :driver => :led, :pin => 13 | |
work do | |
puts "Firmware name: #{board.firmware_name}" | |
puts "Firmata version: #{board.version}" | |
every 1.second do | |
led.on? ? led.off : led.on | |
end | |
end |
@avermeulen based on a suggestion on another thread I managed to get it working by switching from the port from '/dev/tty.usbmodem411' to '/dev/cu.usbmodem1411'
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I get the exact same behaviour