Class LEDHelper
java.lang.Object
com.opensourcewithslu.outputdevices.LEDHelper
The class LEDHelper contains methods that pertain to the control of a LED.
-
Constructor Summary
ConstructorDescriptionLEDHelper
(com.pi4j.io.gpio.digital.DigitalOutput ledOutput) LEGHelper constructor. -
Method Summary
-
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.
-