public static class PiconZero.PiconZeroPwmOutputDevice extends AbstractDevice implements PwmOutputDeviceInterface
Constructor and Description |
---|
PiconZeroPwmOutputDevice(PiconZero piconZero,
String key,
int gpio,
int channel,
float initialValue) |
Modifier and Type | Method and Description |
---|---|
protected void |
closeDevice() |
int |
getChannel() |
int |
getGpio() |
int |
getPwmNum()
Get the device PWM output device number
|
float |
getValue()
Get the current PWM output value (0..1)
|
void |
setValue(float value)
Set the PWM output value (0..1)
|
close, getDeviceFactory, getKey, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getKey, isOpen
public int getGpio()
getGpio
in interface GpioDeviceInterface
public int getChannel()
public int getPwmNum()
PwmOutputDeviceInterface
getPwmNum
in interface PwmOutputDeviceInterface
public float getValue() throws RuntimeIOException
PwmOutputDeviceInterface
getValue
in interface PwmOutputDeviceInterface
RuntimeIOException
- if an I/O error occurspublic void setValue(float value) throws RuntimeIOException
PwmOutputDeviceInterface
setValue
in interface PwmOutputDeviceInterface
value
- Relative value in the range 0..1RuntimeIOException
- if an I/O error occursprotected void closeDevice() throws RuntimeIOException
closeDevice
in class AbstractDevice
RuntimeIOException
Copyright © 2016–2017 mattjlewis. All rights reserved.