Class LEDHelper

java.lang.Object
com.opensourcewithslu.outputdevices.LEDHelper

public class LEDHelper extends Object
The class LEDHelper contains methods that pertain to the control of a LED.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LEDHelper(com.pi4j.io.gpio.digital.DigitalOutput ledOutput)
    LEGHelper constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    blink(int duration)
     
    void
    Turns off the LED by setting the DigitalOutput object to low.
    void
    Turns on the LED by setting the DigitalOutput object to high.
    void
    Switches the state of the LED.

    Methods inherited from class java.lang.Object

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

    • LEDHelper

      public LEDHelper(com.pi4j.io.gpio.digital.DigitalOutput ledOutput)
      LEGHelper constructor.
      Parameters:
      ledOutput - An instance of a Pi4J DigitalOutput object.
  • Method Details

    • ledOn

      public void ledOn()
      Turns on the LED by setting the DigitalOutput object to high.
    • ledOff

      public void ledOff()
      Turns off the LED by setting the DigitalOutput object to low.
    • switchState

      public void switchState()
      Switches the state of the LED. If the LED is on, the LED is turned off and vice versa.
    • blink

      public void blink(int duration)
      Parameters:
      duration - blink will take the duration parameter and have the led blink for that duration.