Skip to main content

Meadow.Foundation.FeatherWings.ServoWing

ServoWing
StatusStatus badge: working
Source codeGitHub
Datasheet(s)GitHub
NuGet packageNuGet Gallery for Meadow.Foundation.FeatherWings.ServoWing

Code Example

ServoWing servoWing;
Servo servo;

public override Task Initialize()
{
Console.WriteLine("Initializng ...");

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

servo = servoWing.GetServo(0, NamedServoConfigs.SG90);

return Task.CompletedTask;
}

public override async Task Run()
{
while (true)
{
Console.WriteLine("0");
await servo.RotateTo(new Angle(0, AU.Degrees));
await Task.Delay(1000);

Console.WriteLine("45");
await servo.RotateTo(new Angle(45, AU.Degrees));
await Task.Delay(1000);

Console.WriteLine("90");
await servo.RotateTo(new Angle(90, AU.Degrees));
await Task.Delay(1000);

Console.WriteLine("135");
await servo.RotateTo(new Angle(135, AU.Degrees));
await Task.Delay(1000);
}
}

Sample project(s) available on GitHub

Class ServoWing

Represents Adafruit's Feather Servo Wing and 16-Channel 12-bit PWM/Servo Shield

Assembly: ServoWing.dll
View Source
Declaration
public class ServoWing

Methods

GetServo(byte, ServoConfig)

Returns the specified servo

View Source
Declaration
public Servo GetServo(byte portIndex, ServoConfig servoConfig)
Returns

Meadow.Foundation.Servos.Servo

Parameters
TypeName
System.ByteportIndex
Meadow.Foundation.Servos.ServoConfigservoConfig

GetContinuousRotatioServo(byte, ServoConfig)

Returns the specified continues rotation servo

View Source
Declaration
public IContinuousRotationServo GetContinuousRotatioServo(byte portIndex, ServoConfig servoConfig)
Returns

Meadow.Foundation.Servos.IContinuousRotationServo

Parameters
TypeName
System.ByteportIndex
Meadow.Foundation.Servos.ServoConfigservoConfig
Exceptions

System.ArgumentException