Introducing the arduino_mega gem

The arduino mega gem inherits its functiality from the arduino gem.

Here's a simple example of an LED on pin 13 flashing for a second:

require 'arduino_mega'

am = ArduinoMega.new("/dev/ttyUSB0"){
am.p13h = true
sleep(1)
am.p13h = false
am.close

Here's the same example except in block form:

ArduinoMega.new "/dev/ttyUSB0" do |x|
  x.p13h = true
  sleep(1)
  x.p13h = false
end

Tags:
Source:
1843hrs.md
Published:
27-03-2014 18:43