Class ReedSwitchHelper

java.lang.Object
com.opensourcewithslu.inputdevices.ReedSwitchHelper

public class ReedSwitchHelper extends Object
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    boolean
    Shows if the reed switch has detected magnetic field.
  • Constructor Summary

    Constructors
    Constructor
    Description
    ReedSwitchHelper(com.pi4j.io.gpio.digital.DigitalInput reedSwitchDigitalInput)
    ReedSwitchHelper constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addEventListener(com.pi4j.io.gpio.digital.DigitalStateChangeListener function)
    Adds an event listener to the Reed switch.
    void
    Removes the event listener from the Reed switch.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • isDetected

      public boolean isDetected
      Shows if the reed switch has detected magnetic field.
  • Constructor Details

    • ReedSwitchHelper

      public ReedSwitchHelper(com.pi4j.io.gpio.digital.DigitalInput reedSwitchDigitalInput)
      ReedSwitchHelper constructor.
      Parameters:
      reedSwitchDigitalInput - A Pi4J DigitalInput object.
  • Method Details

    • addEventListener

      public void addEventListener(com.pi4j.io.gpio.digital.DigitalStateChangeListener function)
      Adds an event listener to the Reed switch.
      Parameters:
      function - A Pi4J DigitalStateChangeListener object.
    • removeEventListener

      public void removeEventListener()
      Removes the event listener from the Reed switch.