Skip to content

Instantly share code, notes, and snippets.

@patcoll
Created December 15, 2010 18:59
Show Gist options
  • Save patcoll/742421 to your computer and use it in GitHub Desktop.
Save patcoll/742421 to your computer and use it in GitHub Desktop.
arduino_funnel_sinatra_app.rb
require 'rubygems'
require 'sinatra'
$: << '..'
# prepare for using the Funnel library
require 'funnel'
include Funnel
# configure pin(s) of the Arduino board
config = Arduino.FIRMATA
config.set_digital_pin_mode(13, OUT)
aio = Arduino.new :config => config, :host => "192.168.1.145"
get '/on' do
aio.digital_pin(13).value = 1
end
get '/off' do
aio.digital_pin(13).value = 0
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment