-
Notifications
You must be signed in to change notification settings - Fork 24
NeoPixels can't be disabled #75
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
A bit more troubleshooting reveals that when the library attempts to initialize the DigitalInOut for the Adafruit_CircuitPython_MagTag/adafruit_magtag/peripherals.py Lines 47 to 52 in e1e6a63
Is raising and catching the error. I added
|
I have also found that bypassing the library and directly handling the NEOPIXEL and import time
import board
import neopixel
from digitalio import DigitalInOut, Direction
neopixel_disable = DigitalInOut(board.NEOPIXEL_POWER)
neopixel_disable.direction = Direction.OUTPUT
neopixel_disable.value = False
pixel_pin = board.NEOPIXEL
num_pixels = 4
ORDER = neopixel.GRB
pixels = neopixel.NeoPixel(
pixel_pin, num_pixels, brightness=0.1, auto_write=False, pixel_order=ORDER
)
pixels.fill((255, 0, 0))
pixels.show()
time.sleep(1)
neopixel_disable.value = True
pixels.fill((0, 0, 255))
pixels.show()
time.sleep(1) |
I think I understand the root of this issue. the This means it's already in use by the time the MagTag library tries to initialize it. With my other direct pin example above I initialized the power pin first so it was in use when neopixel tried to initialize it and it silently catches that error and moves on. |
@FoamyGuy and https://forums.adafruit.com/viewtopic.php?f=60&t=186080 report NeoPixel disabling no (no longer/) works.
Example:
Pixels still turn blue.
The text was updated successfully, but these errors were encountered: