I am programming a rotator using Delphi, with two different angles: azimuth and elevation. Up to now I am testing, so I tried to move the rotator 1 by 1 degree in azimuth and elevation. The rotator starts in (0,0) and finishes in (30,30).Another important thing is that I need to pause or have the program sleep before the rotator reads the next azimuth and elevation angle because of the operating of the device.  If I don't do this, the application crashes. So I implemented this, having the program sleep for 0.64 seconds before increasing the angles.Do you think that this program is properly implemented? In the future I will program a Path Wizard to set the path and the step, so I need to know if there is an easier way to do it. I don't know if using Sleep is the proper way to implement it.procedure TForm1.btn_testClick(Sender: TObject); var p: TMD_ALL_ROTOR_ANGLES_PARAMS;    error_flag, step: Integer;begin     p.calibration := 0;     p.angles[0] := -1;     p.angles[1] := -1;     p.startMotorIx := 0;     p.dev.group := 1;     p.dev.number := 1;     error_flag := 0;     step:= 1;     While (p.angles[0] < 30) And (p.angles[1] < 30) do     begin          p.angles[0] := p.angles[0] + step;          p.angles[1] := p.angles[1] + step;          case md_set_all_rotor_angles(@app_id, @p) of          MD_NO_ERROR: Sleep(640);           else             error_flag := error_flag + 1;          end;     end;     if error_flag > 0 then     ShowMessage('error');end;  This is the documentation provided by the manufacturer.  I modified the test program slightly to add the function that I described above. In the doc folder there is a file which describes the library, but I didn't find it really helpful.As you have seen, the documentation that I have is not really helpful, and the manufacturer doesn't answer my emails. Now I'd like to know when the initial angles are reached in order to start moving the rotator. I mean, if I am in position (5,5) and I want to move from (10,10) to (20,20), I move the rotator to (10,10) and I need to know when the rotator is in that position to start moving to (20,20). I could calculate the time by subtracting the angles and using the time needed per angle. So I could use the Sleep command to have program slept during that time, and then start the trajectory. I have another file in case it could be helpful, but it is not for me.
Sleeping in Delphi
delphi