Package com.diozero.devices
Class PwmServo
- java.lang.Object
-
- com.diozero.api.GpioDevice
-
- com.diozero.devices.PwmServo
-
- All Implemented Interfaces:
DeviceInterface
,AutoCloseable
@Deprecated public class PwmServo extends GpioDevice
Deprecated.UseServoDevice
instead.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
PwmServo.OutputDeviceUnit
Deprecated.
-
Field Summary
-
Fields inherited from class com.diozero.api.GpioDevice
pinInfo
-
-
Constructor Summary
Constructors Constructor Description PwmServo(int gpio, float initialPulseWidthMs)
Deprecated.PwmServo(int gpio, float initialPulseWidthMs, int pwmFrequency)
Deprecated.PwmServo(int gpio, float initialPulseWidthMs, int pwmFrequency, ServoTrim trim)
Deprecated.PwmServo(int gpio, float initialPulseWidthMs, ServoTrim trim)
Deprecated.PwmServo(PwmOutputDeviceFactoryInterface pwmDeviceFactory, int gpio, float initialPulseWidthMs, int pwmFrequency)
Deprecated.PwmServo(PwmOutputDeviceFactoryInterface pwmDeviceFactory, int gpio, float initialPulseWidthMs, int pwmFrequency, ServoTrim trim)
Deprecated.PwmServo(PwmOutputDeviceFactoryInterface pwmDeviceFactory, PinInfo pinInfo, float initialPulseWidthMs, int pwmFrequency, ServoTrim trim)
Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
centre()
Deprecated.void
close()
Deprecated.Close this devicefloat
getAngle()
Deprecated.Get the current servo angle where 90 degrees is the middle positionPwmServo.OutputDeviceUnit
getOutputDeviceUnit()
Deprecated.float
getPulseWidthMs()
Deprecated.Get the current servo pulse width in millisecondsint
getPwmFrequency()
Deprecated.float
getValue()
Deprecated.void
max()
Deprecated.void
min()
Deprecated.void
setAngle(int angle)
Deprecated.Turn the servo to the specified angle where 90 is the middle positionPwmServo
setInverted(boolean inverted)
Deprecated.PwmServo
setOutputDeviceUnit(PwmServo.OutputDeviceUnit outputDeviceUnit)
Deprecated.void
setPulseWidthMs(float pulseWidthMs)
Deprecated.Set the servo pulse width in millisecondsvoid
setValue(float value)
Deprecated.-
Methods inherited from class com.diozero.api.GpioDevice
getGpio
-
-
-
-
Constructor Detail
-
PwmServo
public PwmServo(int gpio, float initialPulseWidthMs) throws RuntimeIOException
Deprecated.- Throws:
RuntimeIOException
-
PwmServo
public PwmServo(int gpio, float initialPulseWidthMs, ServoTrim trim) throws RuntimeIOException
Deprecated.- Throws:
RuntimeIOException
-
PwmServo
public PwmServo(int gpio, float initialPulseWidthMs, int pwmFrequency) throws RuntimeIOException
Deprecated.- Throws:
RuntimeIOException
-
PwmServo
public PwmServo(int gpio, float initialPulseWidthMs, int pwmFrequency, ServoTrim trim) throws RuntimeIOException
Deprecated.- Throws:
RuntimeIOException
-
PwmServo
public PwmServo(PwmOutputDeviceFactoryInterface pwmDeviceFactory, int gpio, float initialPulseWidthMs, int pwmFrequency) throws RuntimeIOException
Deprecated.- Throws:
RuntimeIOException
-
PwmServo
public PwmServo(PwmOutputDeviceFactoryInterface pwmDeviceFactory, int gpio, float initialPulseWidthMs, int pwmFrequency, ServoTrim trim) throws RuntimeIOException
Deprecated.- Throws:
RuntimeIOException
-
PwmServo
public PwmServo(PwmOutputDeviceFactoryInterface pwmDeviceFactory, PinInfo pinInfo, float initialPulseWidthMs, int pwmFrequency, ServoTrim trim) throws RuntimeIOException
Deprecated.- Throws:
RuntimeIOException
-
-
Method Detail
-
getOutputDeviceUnit
public PwmServo.OutputDeviceUnit getOutputDeviceUnit()
Deprecated.
-
setOutputDeviceUnit
public PwmServo setOutputDeviceUnit(PwmServo.OutputDeviceUnit outputDeviceUnit)
Deprecated.
-
setInverted
public PwmServo setInverted(boolean inverted)
Deprecated.
-
close
public void close()
Deprecated.Description copied from interface:DeviceInterface
Close this device
-
getPwmFrequency
public int getPwmFrequency()
Deprecated.
-
getValue
public float getValue()
Deprecated.
-
setValue
public void setValue(float value)
Deprecated.
-
getPulseWidthMs
public float getPulseWidthMs()
Deprecated.Get the current servo pulse width in milliseconds- Returns:
- The servo pulse width (milliseconds)
-
setPulseWidthMs
public void setPulseWidthMs(float pulseWidthMs)
Deprecated.Set the servo pulse width in milliseconds- Parameters:
pulseWidthMs
- Servo pulse width (milliseconds)
-
getAngle
public float getAngle()
Deprecated.Get the current servo angle where 90 degrees is the middle position- Returns:
- Servo angle (90 degrees is middle)
-
setAngle
public void setAngle(int angle)
Deprecated.Turn the servo to the specified angle where 90 is the middle position- Parameters:
angle
- Servo angle (90 degrees is middle)
-
min
public void min()
Deprecated.
-
max
public void max()
Deprecated.
-
centre
public void centre()
Deprecated.
-
-