Package com.diozero.devices
Class PwmLedBarGraph
- java.lang.Object
-
- com.diozero.devices.PwmLedBarGraph
-
- All Implemented Interfaces:
DeviceInterface
,AutoCloseable
public class PwmLedBarGraph extends Object implements DeviceInterface
-
-
Constructor Summary
Constructors Constructor Description PwmLedBarGraph(int... gpios)
PwmLedBarGraph(PwmLed... leds)
PwmLedBarGraph(PwmOutputDeviceFactoryInterface deviceFactory, int... gpios)
PwmLedBarGraph(List<PwmLed> leds)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
blink()
void
close()
Close this devicefloat
getValue()
Get the proportion of LEDs currently lit.void
off()
void
on()
void
pulse(float fadeTime, int steps, int iterations)
void
setValue(float newValue)
Light a proportion of the LEDs using value as a percentage.void
toggle()
-
-
-
Constructor Detail
-
PwmLedBarGraph
public PwmLedBarGraph(int... gpios)
-
PwmLedBarGraph
public PwmLedBarGraph(PwmOutputDeviceFactoryInterface deviceFactory, int... gpios)
-
PwmLedBarGraph
public PwmLedBarGraph(PwmLed... leds)
-
-
Method Detail
-
on
public void on()
-
off
public void off()
-
toggle
public void toggle()
-
blink
public void blink()
-
pulse
public void pulse(float fadeTime, int steps, int iterations)
-
getValue
public float getValue()
Get the proportion of LEDs currently lit.- Returns:
- Proportion of LEDs lit. 0..1 if lit from left to right, 0..-1 if lit from right to left.
-
setValue
public void setValue(float newValue)
Light a proportion of the LEDs using value as a percentage.- Parameters:
newValue
- Proportion of LEDs to light. 0..1 lights from left to right, 0..-1 lights from right to left.
-
close
public void close() throws RuntimeIOException
Description copied from interface:DeviceInterface
Close this device- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceDeviceInterface
- Throws:
RuntimeIOException
-
-