Class GarminLidarLiteV4

    • Constructor Detail

      • GarminLidarLiteV4

        public GarminLidarLiteV4()
    • Method Detail

      • getUnitId

        public byte[] getUnitId()
        Get the device's unit id (serial number).
        Returns:
        the device's unit id (serial number)
      • getHardwareVersion

        public int getHardwareVersion()
        Get the device's hardware version identifier.
        Returns:
        hardware version
      • getFirmwareVersion

        public int getFirmwareVersion()
        Get the device's coprocessor firmware version number. 210 == v2.10
        Returns:
        coprocessor firmware version
      • getLibraryVersion

        public String getLibraryVersion()
        Get the Garmin software library version string
        Returns:
        Garmin software library version string
      • factoryReset

        public void factoryReset()
        Resets the NVM/Flash storage information back to default settings and executes a SoftDevice reset.
      • getBoardTemperature

        public int getBoardTemperature()
        Read the board's temperature in degrees Celsius.
        Returns:
        the board temperature in degrees Celsius
      • getSoCTemperature

        public int getSoCTemperature()
        Read the temperature of the nRF SoC in degrees Celsius.
        Returns:
        the board temperature in degrees Celsius
      • getStatusByte

        public byte getStatusByte()
        Read the STATUS register byte value.
        Returns:
        status register byte value
      • isDeviceBusy

        public boolean isDeviceBusy()
        Read the STATUS register to determine if the device is busy or not
        Returns:
        true if the device is busy taking a measurement or powering on
      • setPowerMode

        public void setPowerMode​(GarminLidarLiteV4.PowerMode powerMode)
        NOTE: You must disable HIGH_ACCURACY_MODE before you adjust the power mode.
        Parameters:
        powerMode - the new power mode
      • isFlashStorageEnabled

        public boolean isFlashStorageEnabled()
        Storage to be used for register settings.
        Returns:
        whether or not to use Flash/NVM storage for registry settings
      • setFlashStorage

        public void setFlashStorage​(boolean enabled)

        Storage for register settings.

        NOTE: Use caution when enabling flash storage. The total number of writes and erases is limited to 10,000.

        Enabled
        Use RAM storage only. When the device is reset, default values are loaded.
        Disabled
        Use FLASH/NVM storage. Any register that supports both read and write operations is stored in NVM and persists over power cycles. When the device is reset, the values stored in NVM are loaded instead of the default values.
        Parameters:
        enabled - whether or not to use Flash/NVM storage for register settings
      • getHighAccuracyMode

        public int getHighAccuracyMode()
        Get the high accuracy mode. While high accuracy mode is disabled, you can adjust the GarminLidarLiteV4.PowerMode to Asynchronous or Synchronous if required.
        0x00
        High accuracy mode is disabled
        0x01 to 0xFF
        High accuracy mode is enabled. The value is used as the number of distance measurements to accumulate and average before returning them to the user.
        Returns:
        the number of distance measurements to accumulate and average before returning them to the user (0 == disabled)
      • isHighAccuracyModeEnabled

        public boolean isHighAccuracyModeEnabled()
        Check if high accuracy mode is enabled.
        Returns:
        high accuracy mode status
      • setHighAccuracyMode

        public void setHighAccuracyMode​(int accuracyMode)
        Set the high accuracy mode. While high accuracy mode is disabled, you can adjust the GarminLidarLiteV4.PowerMode to Asynchronous or Synchronous if required.
        0x00
        High accuracy mode is disabled
        0x01 to 0xFF
        Enable high accuracy mode. The value is used as the number of distance measurements to accumulate and average before returning them to the user.
        Note you must set the GarminLidarLiteV4.PowerMode to Always On before you adjust to a non-zero value.
        Parameters:
        accuracyMode - the number of distance measurements to accumulate and average before returning them to the user (0 == disabled)
      • disableHighAccuracyMode

        public void disableHighAccuracyMode()
      • setReceivedBiasCorrectionEnabled

        public void setReceivedBiasCorrectionEnabled​(boolean enabled)
        Enable / disable the distance measurement receiver bias correction.
        Parameters:
        enabled - receiver bias correction status
      • getMaximumAcquisitionCount

        public int getMaximumAcquisitionCount()
        Get the maximum number of acquisitions during measurement
        Returns:
        maximum acquisition count.
      • setMaximumAcquisitionCount

        public void setMaximumAcquisitionCount​(int acquisitionCount)
        Set the maximum number of acquisitions during measurement.
        Parameters:
        acquisitionCount - maximum acquisition count.
      • getDetectionSensitivity

        public int getDetectionSensitivity()

        Get the detection sensitivity.

        0x00
        Use default valid measurement detection algorithm based on the peak value, signal strength, and noise in the correlation record.
        0x01 to 0xFF
        Set simple threshold for valid measurement detection.

        Values 0x20 to 0x60 generally perform well.

        Returns:
        detectionSensitivity detection sensitivity value (0..255)
      • setDetectionSensitivity

        public void setDetectionSensitivity​(int detectionSensitivity)

        Set the detection sensitivity.

        0x00
        Use default valid measurement detection algorithm based on the peak value, signal strength, and noise in the correlation record.
        0x01 to 0xFF
        Set simple threshold for valid measurement detection.

        Values 0x20 to 0x60 generally perform well.

        Parameters:
        detectionSensitivity - detection sensitivity value (0..255)
      • isQuickAcquistionTerminationEnabled

        public boolean isQuickAcquistionTerminationEnabled()
        Get the status of the quick acquisition termination flag. If enabled the device terminates the distance measurement early if it anticipates the signal peak in the correlation record will reach the maximum value.
        Returns:
        acquisition quick termination status
      • setQuickTerminationEnabled

        public void setQuickTerminationEnabled​(boolean enabled)
        Set the quick acquisition termination flag. If enabled the device terminates the distance measurement early if it anticipates the signal peak in the correlation record will reach the maximum value.
        Parameters:
        enabled - quick acquisition termination value
      • getCorrelationData

        public short[] getCorrelationData​(int numberOfReadings)

        The correlation record used to calculate distance can be read from the device. It has a bipolar wave shape, transitioning from a positive going portion to a roughly symmetrical negative going pulse. The point where the signal crosses zero represents the effective delay for the reference and return signals.

        Process:

        1. Take a distance reading (there is no correlation record without at least one distance reading being taken)
        2. For as many points as you want to read from the record (max is 192) read the two byte signed correlation data point.
        Parameters:
        numberOfReadings - The number of readings to take up to a maximum of 192
        Returns:
        the correlation data
      • resetCorrelationData

        public void resetCorrelationData()
        Reset the correlation data pointer
      • configure

        public void configure​(GarminLidarLiteV4.Preset preset)
        Selects one of several preset configurations as per the Garmin Arduino library configure function.
        Parameters:
        preset - preset max acquisition count and quick termination values
      • getDistanceMeasurement

        public int getDistanceMeasurement()
        Get the distance measurement result in centimetres.
        Returns:
        distance measurement result in centimetres