CLUE ble beacon remote#3239
Merged
Merged
Conversation
clue ble remote code
Contributor
Author
|
@TheKitty @BlitzCityDIY CLUE ble remote code is ready to checkout |
BlitzCityDIY
requested changes
May 8, 2026
Collaborator
BlitzCityDIY
left a comment
There was a problem hiding this comment.
hihi- just some minor fixes, mainly formatting
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) |
Collaborator
There was a problem hiding this comment.
none of these should be internal, they're being called directly
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 | ||
|
|
Collaborator
There was a problem hiding this comment.
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(): |
Collaborator
There was a problem hiding this comment.
this feels over complicated, especially with the time.sleep calls for a debounce while using the debounce library
formatting issue fixes in code.py
Contributor
Author
|
sweet thanks @BlitzCityDIY updated code.py with recommend formatting, tested on hardware and all works great |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
CLUE ble remote code for magic devices