Remarks

ServoWing
Status
Source code GitHub
NuGet package

Code Example

public class MeadowApp : App<F7Micro, MeadowApp>
{
    ServoWing servoWing;

    public MeadowApp()
    {
        Initialize();
        Run();
    }

    void Initialize()
    {
        Console.WriteLine("Initialize hardware...");

        var i2CBus = Device.CreateI2cBus(I2cBusSpeed.FastPlus);
        servoWing = new ServoWing(i2CBus);

        Console.WriteLine("Initialize wing...");
        servoWing.Initialize();
    }

    void Run()
    {
        Console.WriteLine("Run...");

        var servo = servoWing.GetServo(0, Meadow.Foundation.Servos.NamedServoConfigs.SG90);

        while (true)
        {
            Console.WriteLine("0");
            servo.RotateTo(0);
            Thread.Sleep(1000);

            Console.WriteLine("45");
            servo.RotateTo(45);
            Thread.Sleep(1000);

            Console.WriteLine("90");
            servo.RotateTo(90);
            Thread.Sleep(1000);

            Console.WriteLine("135");
            servo.RotateTo(135);
            Thread.Sleep(1000);
        }
    }
}
Characteristic Locus
Inheritance System.Object > ServoWing
Inherited Members System.Object.ToString() System.Object.Equals(System.Object) System.Object.Equals(System.Object, System.Object) System.Object.ReferenceEquals(System.Object, System.Object) System.Object.GetHashCode() System.Object.GetType() System.Object.MemberwiseClone()
Namespace Meadow.Foundation.FeatherWings
Assembly ServoWing.dll

Syntax

public class ServoWing

Constructors

ServoWing(II2cBus, Byte, Int32, Int16)

Declaration
public ServoWing(II2cBus i2cBus, byte address = 64, int frequency = 50, short portCount = 8)

Parameters

Type Name Description
II2cBus i2cBus
System.Byte address
System.Int32 frequency
System.Int16 portCount

Fields

pca9685

Declaration
protected Pca9685 pca9685

Field Value

Type Description
Pca9685

Methods

GetContinuousRotatioServo(Byte, ServoConfig)

Declaration
public IContinuousRotationServo GetContinuousRotatioServo(byte portIndex, ServoConfig servoConfig)

Parameters

Type Name Description
System.Byte portIndex
ServoConfig servoConfig

Returns

Type Description
IContinuousRotationServo

GetServo(Byte, ServoConfig)

Declaration
public Servo GetServo(byte portIndex, ServoConfig servoConfig)

Parameters

Type Name Description
System.Byte portIndex
ServoConfig servoConfig

Returns

Type Description
Servo

Initialize()

Declaration
public void Initialize()