No commit activity in last 3 years
No release in over 3 years
A Humble RPi plugin to detect movement using a tilt sensor.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0.10.6, ~> 0.10
>= 0.1.2, ~> 0.1
 Project Readme

Introducing the Humble_RPi-plugin-TiltSensor gem

Testing the plugin

require 'humble_rpi-plugin-tiltsensor'

class Echo

  def notice(s)
    puts "%s: %s" % [Time.now, s]
  end
end

sensor = HumbleRPiPluginTiltSensor.new(settings: {pins: [4], \
              duration: '10 seconds'}, variables: {notifier: Echo.new})
sensor.start

Output:

2016-03-05 18:37:05 +0000: pi/tilt/0: detected 7 times within the past 10 seconds
2016-03-05 18:37:27 +0000: pi/tilt/0: detected
2016-03-05 18:37:37 +0000: pi/tilt/0: detected 14 times within the past 10 seconds

Using the plugin with the HumbleRPi gem

require 'humble_rpi'
require 'humble_rpi-plugin-tiltsensor'

r = HumbleRPi.new device_name: 'ottavia', sps_address: '192.168.4.140',\
  plugins: {TiltSensor: {pins: [4]} }
r.start

Resources

humblerpi gem plugin tilt sensor