Skip to content

Commit

Permalink
Merge pull request #67 from WildernessLabs/TimePeriod_updates
Browse files Browse the repository at this point in the history
Update ServoWing to use TimePeriod
  • Loading branch information
jorgedevs authored Jun 28, 2024
2 parents f28e53a + 153f889 commit 28ca5d0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
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

0 comments on commit 28ca5d0

Please sign in to comment.