类 AbstractPwmDevice
java.lang.Object
cn.tpkf.rpi.devices.AbstractDevice
cn.tpkf.rpi.devices.gpio.AbstractGpioDevice
cn.tpkf.rpi.devices.gpio.pwm.AbstractPwmDevice
- 所有已实现的接口:
Device
- 直接已知子类:
PassiveBuzzer
PWM 设备
- 作者:
- Harlan
-
字段概要
字段修饰符和类型字段说明protected final NumberThe duty cycle.protected final IntegerThe frequency.protected final NumberThe initial state.protected final com.pi4j.io.pwm.PwmPolarityThe polarity.protected final com.pi4j.io.pwm.PwmThe PWM instance.protected final com.pi4j.io.pwm.PwmTypeThe PWM type.protected final NumberThe shutdown state.从类继承的字段 cn.tpkf.rpi.devices.gpio.AbstractGpioDevice
address从类继承的字段 cn.tpkf.rpi.devices.AbstractDevice
deviceManager, id, lock, name -
构造器概要
构造器限定符构造器说明protectedAbstractPwmDevice(DeviceManager deviceManager, String id, String name, IBCMEnums address, com.pi4j.io.pwm.PwmType pwmType, Number initial, Number shutdown, Number dutyCycle, Integer frequency, com.pi4j.io.pwm.PwmPolarity polarity) Creates an instance of the AbstractPwmDevice class. -
方法概要
从类继承的方法 cn.tpkf.rpi.devices.gpio.AbstractGpioDevice
getDescription从类继承的方法 cn.tpkf.rpi.devices.AbstractDevice
shutdown
-
字段详细资料
-
pwm
protected final com.pi4j.io.pwm.Pwm pwmThe PWM instance. -
initial
The initial state. -
shutdown
The shutdown state. -
dutyCycle
The duty cycle. -
frequency
The frequency. -
polarity
protected final com.pi4j.io.pwm.PwmPolarity polarityThe polarity. -
pwmType
protected final com.pi4j.io.pwm.PwmType pwmTypeThe PWM type.
-
-
构造器详细资料
-
AbstractPwmDevice
protected AbstractPwmDevice(DeviceManager deviceManager, String id, String name, IBCMEnums address, com.pi4j.io.pwm.PwmType pwmType, Number initial, Number shutdown, Number dutyCycle, Integer frequency, com.pi4j.io.pwm.PwmPolarity polarity) Creates an instance of the AbstractPwmDevice class.- 参数:
deviceManager- The DeviceManager instance.id- The ID of the device.name- The name of the device.address- The IBCMEnums address of the device.pwmType- The PWM type.initial- The initial state.shutdown- The shutdown state.dutyCycle- The duty cycle.frequency- The frequency.polarity- The polarity.
-
-
方法详细资料
-
on
on- 参数:
dutyCycle- The duty cycle.frequency- The frequency.
-
on
public void on(int frequency) on- 参数:
frequency- The frequency.
-
off
public void off()off -
isOn
public boolean isOn()isOn- 返回:
- true if the PWM is on.
-
isOff
public boolean isOff()isOff- 返回:
- true if the PWM is off.
-