Skip to content

jrobertson/arduino_mega

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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.

About

Arduino Mega is designed to expose the pins rather than the function. It inherits its functionality from the Arduino gem

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages