require 'serialport' require 'sinatra' arduinoSerialPort = 'COM22' arduinoSerialPortSpeed = 9600 sp = SerialPort.new(arduinoSerialPort, arduinoSerialPortSpeed, 8, 1, SerialPort::NONE) htmlCode = "BODY" get '/' do body = "Shoot Stuff
" body += "Light All LEDs
" body += "Mario Coin Sound
" htmlCode.gsub("BODY", body) end get '/shootstuff' do sp.write "1" body = "Stuff Should be shooting
" body += "Return to Actions
" htmlCode.gsub("BODY", body) end get '/lightallleds' do body = "All LEDs Should Be Lit
" body += "Return to Actions
" htmlCode.gsub("BODY", body) sp.write "2" end get '/coinsound' do body = "Coin Sound Should Have Sounded
" body += "Return to Actions
" htmlCode.gsub("BODY", body) sp.write "3" end