No commit activity in last 3 years
No release in over 3 years
Tests the rpi_pinin_msgout gem by simulating the triggering of a pin high event using the keyboard's spacebar key.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 0.3.2, ~> 0.3
 Project Readme

Introducing the rpi_pinin_msgout-test gem

This gem is designed to make it convenient to evaluate the rpi-pinin-msgout gem without having to set up a push button for example on a Raspberry Pi. Instead, the spacebar key simulates the pressing of a button.

Here's a couple of examples:

# default mode

require 'rpi_pinin_msgout-test'

pin = RPiPinInMsgOutTest.new(4, pull: :up, mode: :default)
pin.capture

Output:

2017-01-14 20:29:36 +0000
2017-01-14 20:29:37 +0000
2017-01-14 20:29:38 +0000
2017-01-14 20:29:38 +0000
2017-01-14 20:29:38 +0000
2017-01-14 20:29:39 +0000
2017-01-14 20:29:39 +0000
# secretkock mode

require 'rpi_pinin_msgout-test'

pin = RPiPinInMsgOutTest.new(4, pull: :up, mode: :secretknock)
pin.capture

Output:

2017-01-14 20:30:14 +0000

1 2017-01-14 20:30:14 +0000
2 2017-01-14 20:30:17 +0000: pi/sensor/0: e
                                           2017-01-14 20:30:19 +0000

1 2017-01-14 20:30:19 +0000
2 2017-01-14 20:30:20 +0000
3 2017-01-14 20:30:22 +0000: pi/sensor/0: t
                                           2017-01-14 20:30:27 +0000

1 2017-01-14 20:30:27 +0000

1 2017-01-14 20:30:28 +0000
2 2017-01-14 20:30:28 +0000
3 2017-01-14 20:30:28 +0000
4 2017-01-14 20:30:28 +0000
5 2017-01-14 20:30:29 +0000
6 2017-01-14 20:30:31 +0000: pi/sensor/0: l

Notes:

  • The rpi_pinin_msgout gem was design to be used by the humble_rpi-plugin-button gem.
  • The default notifier (which outputs the product from 1 or more keypresses) is used although it can be changed.

Resources