In version 0.2.x, there was 1 primary class for continually monitoring a port for tag events. This doesn't do everything I wanted though, because in some cases I really just needed to know what tags were in range at one precise instant. The long-running class really wasn't a good fit, so there's a new class available called TagIt::TagSnapshot which has a "shoot!" method that returns an array of the tag-names currently found:
require "tag_it"
port = SerialPort.new("/dev/tty.yourport",{:baud=>9600})
snapshot = TagIt::TagSnapshot.new(port)
tags = snapshot.shoot!
# => ["1nri","1okD","1nrP"]
Get the latest:
gem install tag-it

0 comments:
Post a Comment