public class Led
extends java.lang.Object
Modifier | Constructor and Description |
---|---|
protected |
Led(int ledNb)
Constructs a led with its number
|
Modifier and Type | Method and Description |
---|---|
com.pi4j.io.gpio.GpioPinDigitalOutput |
getGpioPinDigitalOutput()
Retrieve pi4j Gpio digital output pin interface corresponding to the LED.
|
boolean |
isOff()
Check if the LED is off.
|
boolean |
isOn()
Check if the LED is on.
|
void |
off()
Turns the LED off.
|
void |
on()
Turns the LED on.
|
void |
pulse(long duration)
Turns the LED on for duration seconds and then off.
|
void |
toggle()
If the LED is on, turns it off.
|
protected Led(int ledNb)
ledNb
- the led number (1 or 2)public com.pi4j.io.gpio.GpioPinDigitalOutput getGpioPinDigitalOutput()
public boolean isOn()
public boolean isOff()
public void on()
public void off()
public void toggle()
public void pulse(long duration)
duration
- in milliseconds.