Skip to main content

Class ServoBase

Represents the base class for a servo, implementing common functionality.

Assembly: Servos.dll
View Source
Declaration
public abstract class ServoBase : IServo, IDisposable

Derived:
Meadow.Foundation.Servos.AngularServo

Implements:
Meadow.Peripherals.Servos.IServo, System.IDisposable

Properties

RequiredFrequency

Gets the required PWM frequency for the servo.

View Source
Declaration
public static Frequency RequiredFrequency { get; }

IsDisposed

Gets a value indicating whether the servo has been disposed.

View Source
Declaration
public bool IsDisposed { get; }

PwmPort

Gets the PWM port used to control the servo.

View Source
Declaration
protected IPwmPort PwmPort { get; }

TrimOffset

Gets or sets the trim offset for the servo. The trim offset is used to adjust the neutral position of the servo.

View Source
Declaration
public TimePeriod TrimOffset { get; set; }

Methods

Neutral()

Sets the servo to its neutral position.

View Source
Declaration
public abstract void Neutral()

SetPulseWidthWithTrim(TimePeriod)

Send a command pulse

View Source
Declaration
protected virtual void SetPulseWidthWithTrim(TimePeriod pulseDuration)
Parameters
TypeNameDescription
Meadow.Units.TimePeriodpulseDurationThe pulse duration

Disable()

Disables the servo, stopping any movement.

View Source
Declaration
public virtual void Disable()

Dispose(bool)

View Source
Declaration
protected virtual void Dispose(bool disposing)
Parameters
TypeName
System.Booleandisposing

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

View Source
Declaration
public void Dispose()

Implements

  • Meadow.Peripherals.Servos.IServo
  • System.IDisposable