Skip to content

Instantly share code, notes, and snippets.

@aripoya
Forked from tenderlove/nfc_and_me.rb
Created February 7, 2013 03:19
Show Gist options
  • Save aripoya/4728124 to your computer and use it in GitHub Desktop.
Save aripoya/4728124 to your computer and use it in GitHub Desktop.
require 'nfc'
tags = {
"04823691212580" => "Fitter, happier, more productive",
"04673391212580" => "comfortable",
"04C33091212580" => "not drinking too much",
"04C92C91212580" => "regular exercise at the gym",
"04F15D91212580" => "three days a week",
"041C9F91212581" => "getting on better with your associate employee contemporaries",
"04D79A91212580" => "at ease",
"04933791212580" => "eating well",
"047EEA51962280" => "no more microwave dinners and saturated fats",
"0409A691212581" => "a patient better driver",
}
trap('INT') {
NFC.instance.device.disconnect
exit
}
loop do
NFC.instance.find do |tag|
p tag.to_s => tags[tag.to_s]
system("say #{tags[tag.to_s]}")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment