0.0
No commit activity in last 3 years
No release in over 3 years
arduino_mega
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

 Project Readme

#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

The block form is safer since it automatically closes the serial stream when the block has ended.