Sha256: 65956d437168ca47bf5cff6099f537866dc5c7273ceba05f6146314ee2cf98c5

Contents?: true

Size: 499 Bytes

Versions: 2

Compression:

Stored size: 499 Bytes

Contents

require 'bundler/setup'
require 'firmata'
require 'socket'

#sp = 'COM3' # windows
#sp = '/dev/ttyACM0' #linux
sp = '/dev/cu.usbmodem1451' #mac

board = Firmata::Board.new(sp)

board.connect

puts "Firmware name #{board.firmware_name}"
puts "Firmata version #{board.version}"

pin_number = 13
rate = 0.5

10.times do
  board.digital_write pin_number, Firmata::PinLevels::HIGH
  puts '+'
  board.delay rate

  board.digital_write pin_number, Firmata::PinLevels::LOW
  puts '-'
  board.delay rate
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
hybridgroup-firmata-0.4.7 examples/blink_led.rb
hybridgroup-firmata-0.4.6 examples/blink_led.rb