Skip to content

Instantly share code, notes, and snippets.

@avermeulen
Created February 1, 2015 16:17
Show Gist options
  • Save avermeulen/dd71099312277eb40614 to your computer and use it in GitHub Desktop.
Save avermeulen/dd71099312277eb40614 to your computer and use it in GitHub Desktop.
Blinking an LED using ruby
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
@veldtmana
Copy link

@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