Created
April 9, 2013 20:06
-
-
Save jonahoffline/5348922 to your computer and use it in GitHub Desktop.
Simple ruby script to read temperature / humidity (built with arduino) through bluetooth.
This file contains 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
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