|
void displayPosition(MPICapture capture, MPIAxis axis) { double origin; MPICaptureStatus captureStatus;
/* Check captured position */ mpiCaptureStatus(capture, &captureStatus, NULL);
/* Getting origin variable and store it to origin */ mpiAxisOriginGet(axis, &origin);
if (captureStatus.state == MPICaptureStateCAPTURED) {
printf("Latched actual position: %.0lf\n", captureStatus.latchedValue - origin);
printf("Latched encoder position: %.0lf\n", captureStatus.latchedValue);
}
}
|