Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update ServoWing to use TimePeriod #67

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/ServoWing/Driver/ServoWing.cs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public AngularServo GetServo(byte portIndex, PulseAngle minPulseAngle, PulseAngl
/// <param name="portIndex"></param>
/// <param name="minimumPulseDuration">The minimum pulse duration for the servo.</param>
/// <param name="maximumPulseDuration">The maximum pulse duration for the servo.</param>
public IContinuousRotationServo GetContinuousRotatioServo(byte portIndex, TimeSpan minimumPulseDuration, TimeSpan maximumPulseDuration)
public IContinuousRotationServo GetContinuousRotatioServo(byte portIndex, TimePeriod minimumPulseDuration, TimePeriod maximumPulseDuration)
{
var pin = GetPinForPortIndex(portIndex);

Expand Down
4 changes: 2 additions & 2 deletions Source/ServoWing/Sample/ServoWing_Sample/MeadowApp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ public override Task Initialize()
servoWing = new ServoWing(Device.CreateI2cBus(I2cBusSpeed.FastPlus));

servo = servoWing.GetServo(0,
new AngularServo.PulseAngle(NamedServoConfigs.SG90.MinimumAngle, TimeSpan.FromMilliseconds(NamedServoConfigs.SG90.MinimumPulseDuration)),
new AngularServo.PulseAngle(NamedServoConfigs.SG90.MaximumAngle, TimeSpan.FromMilliseconds(NamedServoConfigs.SG90.MaximumPulseDuration)));
new AngularServo.PulseAngle(NamedServoConfigs.SG90.MinimumAngle, new TimePeriod(NamedServoConfigs.SG90.MinimumPulseDuration, TimePeriod.UnitType.Milliseconds)),
new AngularServo.PulseAngle(NamedServoConfigs.SG90.MaximumAngle, new TimePeriod(NamedServoConfigs.SG90.MaximumPulseDuration, TimePeriod.UnitType.Milliseconds)));

return Task.CompletedTask;
}
Expand Down
Loading