类 AbstractPwmDevice

所有已实现的接口:
Device
直接已知子类:
PassiveBuzzer

public abstract class AbstractPwmDevice extends AbstractGpioDevice
PWM 设备
作者:
Harlan
  • 字段详细资料

    • pwm

      protected final com.pi4j.io.pwm.Pwm pwm
      The PWM instance.
    • initial

      protected final Number initial
      The initial state.
    • shutdown

      protected final Number shutdown
      The shutdown state.
    • dutyCycle

      protected final Number dutyCycle
      The duty cycle.
    • frequency

      protected final Integer frequency
      The frequency.
    • polarity

      protected final com.pi4j.io.pwm.PwmPolarity polarity
      The polarity.
    • pwmType

      protected final com.pi4j.io.pwm.PwmType pwmType
      The 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

      public void on(Number dutyCycle, int frequency)
      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.