PositionChange Index N°6 <> 0° ?
PositionCurrent Index N°6 <> 0,0000 ?
Code: Select all
Servo motor N°6 no connect Pin Phidget 1061_1
PhidgetAdvancedServo1.Open(-1);
PhidgetAdvancedServo1.WaitForAttachment(2000);
PhidgetAdvancedServo1.SpeedRampingOn[6] := True;
PhidgetAdvancedServo1.VelocityLimit[6] := 1;
PhidgetAdvancedServo1.SetServoParameters(6, 440, 2540, 180, 300);
AdvancedX(6, 32, PhidgetAdvancedServo1);
AdvancedX(6, 90, PhidgetAdvancedServo1);
AdvancedX(6, 180,PhidgetAdvancedServo1);
AdvancedX(6, 0,PhidgetAdvancedServo1);
procedure AdvancedX(Servo: Integer; Angle: Integer; AdvServo: TPhidgetAdvancedServo);
begin
AdvServo.Position[Servo] := Angle;
if not AdvServo.Engaged[Servo] then AdvServo.Engaged[Servo] := True;
// As long as the position and different "Angle" then loop
while AdvServo.Position[Servo] <> Angle do
begin
// waits
Application.ProcessMessages;
end;
end;
thank you very much