getDistance method

int getDistance()

Implementation

int getDistance() {
  final pDist = calloc<Uint32>();
  try {
    bindings.distanceSensorGetDistance(_handle!, pDist);
    return pDist.value;
  } catch (e) {
    throw PhidgetException('An error occurred getting the distance: $e');
  } finally {
    calloc.free(pDist);
  }
}