Skip to content

CLUE ble beacon remote#3239

Merged
BlitzCityDIY merged 2 commits into
adafruit:mainfrom
videopixil:CLUE_BLE_Beacon_Remote
May 11, 2026
Merged

CLUE ble beacon remote#3239
BlitzCityDIY merged 2 commits into
adafruit:mainfrom
videopixil:CLUE_BLE_Beacon_Remote

Conversation

@videopixil
Copy link
Copy Markdown
Contributor

CLUE ble remote code for magic devices

clue ble remote code
@videopixil
Copy link
Copy Markdown
Contributor Author

@TheKitty @BlitzCityDIY CLUE ble remote code is ready to checkout

@BlitzCityDIY BlitzCityDIY self-requested a review May 8, 2026 16:36
Copy link
Copy Markdown
Collaborator

@BlitzCityDIY BlitzCityDIY left a comment

Choose a reason for hiding this comment

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

hihi- just some minor fixes, mainly formatting

Comment thread CLUE_BLE_Beacon_Remote/code.py Outdated
Comment on lines +45 to +75
_i2c = board.I2C()
try:
from adafruit_lsm6ds.lsm6ds33 import LSM6DS33
_accel = LSM6DS33(_i2c)
except (OSError, RuntimeError, ImportError):
from adafruit_lsm6ds.lsm6ds3trc import LSM6DS3TRC
_accel = LSM6DS3TRC(_i2c)

_display = board.DISPLAY
_DISPLAY_ACTIVE_BRIGHTNESS = 0.8
_DISPLAY_SLEEP_TIMEOUT_S = 30.0 # sleep TFT backlight after this many idle seconds
_display.brightness = _DISPLAY_ACTIVE_BRIGHTNESS

# Battery voltage monitoring intentionally not implemented on the CLUE.
# Unlike the Feather Sense which has a hardwired voltage divider from the
# LIPO rail, the CLUE has no such divider exposed on CircuitPython's board
# module. Pin-probing testing reads unconnected floating values.
#
# For power awareness, rely on the display auto-sleep feature which is the
# larger power saver anyway (~25-35mA savings when backlight is off).

_pixel = neopixel.NeoPixel(board.NEOPIXEL, 1, brightness=0.3)
_pixel.fill((0, 0, 0))

# PWM-driven speaker avoids per-note audio buffer allocations.
_speaker = pwmio.PWMOut(board.SPEAKER, variable_frequency=True, duty_cycle=0)

_btn_a_io = digitalio.DigitalInOut(board.BUTTON_A)
_btn_a_io.switch_to_input(pull=digitalio.Pull.UP)
_btn_b_io = digitalio.DigitalInOut(board.BUTTON_B)
_btn_b_io.switch_to_input(pull=digitalio.Pull.UP)
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

none of these should be internal, they're being called directly

Comment thread CLUE_BLE_Beacon_Remote/code.py Outdated
Comment on lines +382 to +393
# Try to grab a direct handle to the backlight pin as a fallback. The
# main display object has this pin claimed, so this may fail with
# ValueError - that's fine, we fall back to display.brightness only.
_backlight_pin = None
try:
_backlight_pin = digitalio.DigitalInOut(board.TFT_LITE)
_backlight_pin.switch_to_output(value=True)
except (AttributeError, ValueError, RuntimeError):
# Display module has claimed TFT_LITE - fine, we'll use
# display.brightness alone to control the backlight.
pass

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

if the display.brightness is used and its known that the TFT_LITE pin is in use then this can be taken out

listen_view.set_status(f"Save fail: {err} B", 0xFF0000)


def _wait_for_dismiss_press():
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this feels over complicated, especially with the time.sleep calls for a debounce while using the debounce library

formatting issue fixes in code.py
@videopixil
Copy link
Copy Markdown
Contributor Author

sweet thanks @BlitzCityDIY updated code.py with recommend formatting, tested on hardware and all works great

@BlitzCityDIY BlitzCityDIY merged commit 1f97b68 into adafruit:main May 11, 2026
4 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