Motion detection using the Pi Piper gem

require 'pi_piper'
include PiPiper

after pin: 24, goes: :high do
  puts Time.now.to_s + ' : motion detected'
end

PiPiper.wait    

output:

2013-10-29 19:30:55 +0000 : motion detected
2013-10-29 19:31:01 +0000 : motion detected
2013-10-29 19:31:06 +0000 : motion detected
2013-10-29 19:31:11 +0000 : motion detected
2013-10-29 19:31:18 +0000 : motion detected
2013-10-29 19:31:38 +0000 : motion detected
2013-10-29 19:31:43 +0000 : motion detected

Resources

Tags:
Source:
1936hrs.txt
Published:
29-10-2013 19:36