src/vl53l1x.cpp
uint16_t Vl53l1x::read_range(bool blocking)
{
  if (blocking)
  {
    startTimeout();
    while (!dataReady())
    {
      if (checkTimeoutExpired())
      {
        did_timeout = true;
        return 0;
      }
    }
  }

  readResults();

  if (!calibrated)
  {
    setupManualCalibration();
    calibrated = true;
  }

  updateDSS();

  getRangingData();

  writeReg(SYSTEM__INTERRUPT_CLEAR, 0x01); // sys_interrupt_clear_range

  return ranging_data.range_mm;
}
// Returns a range reading in millimeters when continuous mode is active. If
// blocking is true (the default), this function waits for a new measurement to
// be available. If blocking is false, it will try to return data immediately.
// (readSingle() also calls this function after starting a single-shot range
// measurement)
Returns a range reading in millimeters when continuous mode is active. If
blocking is true (the default), this function waits for a new measurement to
be available. If blocking is false, it will try to return data immediately.
(readSingle() also calls this function after starting a single-shot range
measurement)
Returns a range reading in millimeters when continuous mode is active . If blocking is true ( the default ) this function waits for a new measurement to be available . If blocking is false it will try to return data immediately . ( readSingle () also calls this function after starting a single - shot range measurement )
uint16_t Vl53l1x::read_range(bool blocking)
{
  if (blocking)
  {
    startTimeout();
    while (!dataReady())
    {
      if (checkTimeoutExpired())
      {
        did_timeout = true;
        return 0;
      }
    }
  }
  readResults();
  if (!calibrated)
  {
    setupManualCalibration();
    calibrated = true;
  }
  updateDSS();
  getRangingData();
  writeReg(SYSTEM__INTERRUPT_CLEAR, 0x01); 
  return ranging_data.range_mm;
}
uint16_t Vl53l1x :: read_range ( bool blocking ) { if ( blocking ) { startTimeout ( ) ; while ( ! dataReady ( ) ) { if ( checkTimeoutExpired ( ) ) { did_timeout = true ; return 0 ; } } } readResults ( ) ; if ( ! calibrated ) { setupManualCalibration ( ) ; calibrated = true ; } updateDSS ( ) ; getRangingData ( ) ; writeReg ( SYSTEM__INTERRUPT_CLEAR , 0x01 ) ; return ranging_data . range_mm ; }
Returns a range reading in millimeters when continuous mode is active.
Returns a range reading in millimeters when continuous mode is active .
// sys_interrupt_clear_range