examples/GetDistanceI2cRio/src/LIDARLiteRio.cpp
/*------------------------------------------------------------------------------
  Configure

  Selects one of several preset configurations.

  Parameters
  ------------------------------------------------------------------------------
  configuration:  Default 0.
    0: Default mode, balanced performance.
    1: Short range, high speed. Uses 0x1d maximum acquisition count.
    2: Default range, higher speed short range. Turns on quick termination
        detection for faster measurements at short range (with decreased
        accuracy)
    3: Maximum range. Uses 0xff maximum acquisition count.
    4: High sensitivity detection. Overrides default valid measurement detection
        algorithm, and uses a threshold value for high sensitivity and noise.
    5: Low sensitivity detection. Overrides default valid measurement detection
        algorithm, and uses a threshold value for low sensitivity and noise.
------------------------------------------------------------------------------*/
Configure
Selects one of several preset configurations.

Parameters

Default 0.
0: Default mode, balanced performance.
1: Short range, high speed. Uses 0x1d maximum acquisition count.
2: Default range, higher speed short range. Turns on quick termination
detection for faster measurements at short range (with decreased
accuracy)
3: Maximum range. Uses 0xff maximum acquisition count.
4: High sensitivity detection. Overrides default valid measurement detection
algorithm, and uses a threshold value for high sensitivity and noise.
5: Low sensitivity detection. Overrides default valid measurement detection
algorithm, and uses a threshold value for low sensitivity and noise.
Configure Selects one of several preset configurations . Parameters Default 0 . 0 : Default mode balanced performance . 1 : Short range high speed . Uses 0x1d maximum acquisition count . 2 : Default range higher speed short range . Turns on quick termination detection for faster measurements at short range ( with decreased accuracy ) 3 : Maximum range . Uses 0xff maximum acquisition count . 4 : High sensitivity detection . Overrides default valid measurement detection algorithm and uses a threshold value for high sensitivity and noise . 5 : Low sensitivity detection . Overrides default valid measurement detection algorithm and uses a threshold value for low sensitivity and noise .
void LIDARLite_I2C::configure(int configuration){
  switch(configuration)
  {
    case 0: 
      m_i2c.Write(0x02,0x80); 
      m_i2c.Write(0x04,0x08); 
      m_i2c.Write(0x1c,0x00); 
    break;
    case 1: 
      m_i2c.Write(0x02,0x1d);
      m_i2c.Write(0x04,0x08); 
      m_i2c.Write(0x1c,0x00); 
    break;
    case 2: 
      m_i2c.Write(0x02,0x80); 
      m_i2c.Write(0x04,0x00);
      m_i2c.Write(0x1c,0x00); 
    break;
    case 3: 
      m_i2c.Write(0x02,0xff);
      m_i2c.Write(0x04,0x08); 
      m_i2c.Write(0x1c,0x00); 
    break;
    case 4: 
      m_i2c.Write(0x02,0x80); 
      m_i2c.Write(0x04,0x08); 
      m_i2c.Write(0x1c,0x80);
    break;
    case 5: 
      m_i2c.Write(0x02,0x80); 
      m_i2c.Write(0x04,0x08); 
      m_i2c.Write(0x1c,0xb0);
    break;
  }
}
void LIDARLite_I2C :: configure ( int configuration ) { switch ( configuration ) { case 0 : m_i2c . Write ( 0x02 , 0x80 ) ; m_i2c . Write ( 0x04 , 0x08 ) ; m_i2c . Write ( 0x1c , 0x00 ) ; break ; case 1 : m_i2c . Write ( 0x02 , 0x1d ) ; m_i2c . Write ( 0x04 , 0x08 ) ; m_i2c . Write ( 0x1c , 0x00 ) ; break ; case 2 : m_i2c . Write ( 0x02 , 0x80 ) ; m_i2c . Write ( 0x04 , 0x00 ) ; m_i2c . Write ( 0x1c , 0x00 ) ; break ; case 3 : m_i2c . Write ( 0x02 , 0xff ) ; m_i2c . Write ( 0x04 , 0x08 ) ; m_i2c . Write ( 0x1c , 0x00 ) ; break ; case 4 : m_i2c . Write ( 0x02 , 0x80 ) ; m_i2c . Write ( 0x04 , 0x08 ) ; m_i2c . Write ( 0x1c , 0x80 ) ; break ; case 5 : m_i2c . Write ( 0x02 , 0x80 ) ; m_i2c . Write ( 0x04 , 0x08 ) ; m_i2c . Write ( 0x1c , 0xb0 ) ; break ; } }
Configure
Selects one of several preset configurations.
Configure Selects one of several preset configurations .
// Default mode, balanced performance
 // Default
 // Default
 // Default
 // Short range, high speed
 // Default
 // Default
 // Default range, higher speed short range
 // Default
 // Default
 // Maximum range
 // Default
 // Default
 // High sensitivity detection, high erroneous measurements
 // Default
 // Default
 // Low sensitivity detection, low erroneous measurements
 // Default
 // Default
