Skip to content

Instantly share code, notes, and snippets.

@schappim
Created May 7, 2014 12:15
Show Gist options
  • Select an option

  • Save schappim/a9aee226d40d5fe15db5 to your computer and use it in GitHub Desktop.

Select an option

Save schappim/a9aee226d40d5fe15db5 to your computer and use it in GitHub Desktop.
#!/usr/bin/env ruby
require 'rubygems'
require 'sinatra'
set :bind, '10.0.1.24'
set :port, 80
get '/' do
'hello world'
end
get '/brightness/:level' do
puts params["level"]
level = params['level'].to_f / 100
"my level is #{level}"
`echo "22=#{level}" > /dev/pi-blaster`
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment