require 'pi_piper'
include PiPiper

trigger_watch = 0

watch :pin => 11, :trigger => :falling  do
  puts('trigger registered')
  trigger_watch = 1
end

loop do
 if trigger_watch == 1 then
  puts('trigger 1 detected')
  trigger_watch = 0
 else
  puts('trigger 0 detected')
 end
 sleep(5)
end
