> For the complete documentation index, see [llms.txt](https://learn.breadstick.ca/breadstick/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://learn.breadstick.ca/breadstick/breadsticks/support-boards/i2c-devices/distance-crouton.md).

# Distance Crouton

{% tabs %}
{% tab title="Front" %}

<figure><img src="/files/VCSdV4ZquuvZvgFKPcUX" alt=""><figcaption></figcaption></figure>
{% endtab %}

{% tab title="Back" %}

<figure><img src="/files/0sXFV9LCw9CxjuMSaCQg" alt=""><figcaption></figcaption></figure>
{% endtab %}
{% endtabs %}

## Product Page

<https://shop.breadstick.ca/products/distance-crouton>

## Circuit Python Library

<https://github.com/adafruit/Adafruit_CircuitPython_VL53L4CD>

## VL53L4CD Datasheet

<https://www.st.com/resource/en/datasheet/vl53l4cd.pdf>

## Code

```python
"""
Distance Crouton (VL53L4CD) Demo Code
Breadstick Innovations
April 16, 2024
https://learn.breadstick.ca/breadstick/breadsticks/support-boards/i2c-devices/distance-crouton
"""

import board
import time
import adafruit_vl53l4cd

crouton_i2c = board.I2C()  # Default Breadstick I2C pins D11(SCL) & D12(SDA)
vl53 = adafruit_vl53l4cd.VL53L4CD(crouton_i2c)

# OPTIONAL: can set non-default values
vl53.inter_measurement = 0
vl53.timing_budget = 50

print("VL53L4CD Simple Test.")
print("--------------------")
model_id, module_type = vl53.model_info
print("Model ID: 0x{:0X}".format(model_id))
print("Module Type: 0x{:0X}".format(module_type))
print("Timing Budget: {}".format(vl53.timing_budget))
print("Inter-Measurement: {}".format(vl53.inter_measurement))
print("--------------------")

vl53.start_ranging()

while True:

    #while not vl53.data_ready:
    #    pass
    vl53.clear_interrupt()

    distance = vl53.distance

    plotter_data = (distance,)  # Mu's Plotter only displays tuples, this is a single object tuple
    print(plotter_data)

    print(f'Distance: {distance} cm')
    print("")

    time.sleep(0.1)

```
