public class SoftwarePwmOutputDevice extends AbstractDevice implements PwmOutputDeviceInterface, Runnable
Constructor and Description |
---|
SoftwarePwmOutputDevice(String key,
DeviceFactoryInterface deviceFactory,
GpioDigitalOutputDeviceInterface digitalOutputDevice,
int frequency,
float initialValue) |
Modifier and Type | Method and Description |
---|---|
void |
closeDevice() |
int |
getGpio() |
int |
getPwmNum()
Get the device PWM output device number
|
float |
getValue()
Get the current PWM output value (0..1)
|
void |
run() |
void |
setValue(float value)
Set the PWM output value (0..1)
|
void |
start() |
void |
stop() |
close, getDeviceFactory, getKey, isOpen
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
close, getKey, isOpen
public SoftwarePwmOutputDevice(String key, DeviceFactoryInterface deviceFactory, GpioDigitalOutputDeviceInterface digitalOutputDevice, int frequency, float initialValue)
public void start()
public void stop()
public void closeDevice()
closeDevice
in class AbstractDevice
public float getValue()
PwmOutputDeviceInterface
getValue
in interface PwmOutputDeviceInterface
public void setValue(float value)
PwmOutputDeviceInterface
setValue
in interface PwmOutputDeviceInterface
value
- Relative value in the range 0..1public int getGpio()
getGpio
in interface GpioDeviceInterface
public int getPwmNum()
PwmOutputDeviceInterface
getPwmNum
in interface PwmOutputDeviceInterface
Copyright © 2016–2017 mattjlewis. All rights reserved.