Created
May 7, 2014 12:15
-
-
Save schappim/a9aee226d40d5fe15db5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/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