Skip to content

Conversation

@freemansoft
Copy link

@freemansoft freemansoft commented Jan 6, 2026

Change for the LILYGO T-Dongle-S3 pen drive board https://lilygo.cc/en-us/products/t-dongle-s3

@freemansoft
Copy link
Author

freemansoft commented Jan 6, 2026

This PR was tested

  1. Download the build artifact
  2. Flashed to my LILYGO T-Dongle S3
  3. Verified the status lights per https://learn.adafruit.com/welcome-to-circuitpython/troubleshooting
  4. Ran the following program to verify board.STEMMA_I2C() now functions
import time

import adafruit_vl6180x
import board
import busio

# print(dir(board))

# T-Dongle display
display = board.DISPLAY
# disables the repl on the display for our own use
# display.root_group = None

# Fails on T-Dongle with -> NotImplementedError: No default I2C bus
# This code succeeds with PR https://github.com/adafruit/circuitpython/pull/10773
i2c = board.STEMMA_I2C()
# i2c = busio.I2C(board.STEMMA_SCL, board.STEMMA_SDA)

# manually grab a lock before scanning brought in by ai copilot
while not i2c.try_lock():
    time.sleep(0.5)
# 2. (Optional but recommended) Scan for devices to get addresses
print("Scanning for I2C devices...")
# Get the addresses found on the STEMMA bus
addresses = [hex(addr) for addr in i2c.scan()]
print(f"I2C addresses found on STEMMA bus: {addresses}")
i2c.unlock()

# We don't need to manage locking when using adafruit_bus_device.I2CDevice
print("VL6180X opening device...")
sensor = adafruit_vl6180x.VL6180X(i2c, offset=0)
print("VL6180X found {}".format(sensor))

# You can add an offset to distance measurements here (e.g. calibration)
# Swapping for the following would add a +10 millimeter offset to measurements:
# sensor = adafruit_vl6180x.VL6180X(i2c, offset=10)

# Main loop prints the range and lux every second:
while True:
    # Read the range in millimeters and print it.
    range_mm = sensor.range
    print(f"Range: {range_mm}mm")
    # Read the light, note this requires specifying a gain value:
    # - adafruit_vl6180x.ALS_GAIN_1 = 1x
    # - adafruit_vl6180x.ALS_GAIN_1_25 = 1.25x
    # - adafruit_vl6180x.ALS_GAIN_1_67 = 1.67x
    # - adafruit_vl6180x.ALS_GAIN_2_5 = 2.5x
    # - adafruit_vl6180x.ALS_GAIN_5 = 5x
    # - adafruit_vl6180x.ALS_GAIN_10 = 10x
    # - adafruit_vl6180x.ALS_GAIN_20 = 20x
    # - adafruit_vl6180x.ALS_GAIN_40 = 40x
    light_lux = sensor.read_lux(adafruit_vl6180x.ALS_GAIN_1)
    print(f"Light (1x gain): {light_lux}lux")
    # Delay for a second.
    time.sleep(1.0)

boot_out.txt

Adafruit CircuitPython 10.0.3-4-gc9465b3454 on 2026-01-06; LILYGO T-Dongle S3 with ESP32S3
Board ID:lilygo_tdongle_s3

Copy link
Collaborator

@dhalbert dhalbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. Thanks very much for fixing the board definition.

@dhalbert dhalbert merged commit 3d5d51d into adafruit:10.0.x Jan 6, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants