Skip to content

Instantly share code, notes, and snippets.

@jonahoffline
Created April 9, 2013 20:06
Show Gist options
  • Save jonahoffline/5348922 to your computer and use it in GitHub Desktop.
Save jonahoffline/5348922 to your computer and use it in GitHub Desktop.
Simple ruby script to read temperature / humidity (built with arduino) through bluetooth.
require 'serialport'
require 'eventmachine'
sp = SerialPort.new "/dev/tty.linvor-DevB"
EventMachine::run do
EventMachine::defer do
loop do
temp = sp.gets
next unless temp
puts temp
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment