#Unable to disable NeoPixel on MagTag

1 messages · Page 1 of 1 (latest)

pliant mist
lucid raptor
#

@pliant mist what behavior are you seeing? you set neopixel_disable to True and the neopixels stay on lit to whatever color they were previously?

pliant mist
#

I can try different colours and they still stay lit when I set disable to True

pliant mist
#

The Adafruit code examples/magtag_simpletest.py does not work

lucid raptor
#

I can test this on my magtag tomorrow to see if I'm able to recreate the same behavior.

pliant mist
#

Great - Thanks - I've tried multiple samples and none seem to disable the neopixels ... well except for deep sleep

lucid raptor
#

@pliant mist this doesn't sound like the same thing you were seeing. But just incase. If you're getting an error like this:

code.py output:
Traceback (most recent call last):
  File "code.py", line 7, in <module>
  File "adafruit_magtag/magtag.py", line 102, in __init__
  File "adafruit_magtag/peripherals.py", line 46, in __init__
TypeError: function missing required positional argument #3

go head and update your magtag and neopixel libraries to their newest versions. Mine was originally giving me this error until I updated them.

lucid raptor
#

@pliant mist it seems to be tied to the MagTag library specifically. Bypassing the library and initializing digitalio for the power pin and neopixel on the neopixel pin directly does result in the power pin enabling / disabling the neopixels as expected. I'm taking a closer look into the library to see if I can figure out why it's working this way.

lucid raptor
#

@pliant mist I've figured out the root cause of this issue. There is a PR here that resolves it: https://github.com/adafruit/Adafruit_CircuitPython_MagTag/pull/76 If you are interested you can grab the library code from that branch and it use it on your device. It should allow you to enable / disable the neopixels. You can also wait for it to get merged into the library and get it from the bundle using the normal process after the merge and release occur.

pliant mist
#

While waiting around, I went and tried the Mag Tides Viewer example - https://learn.adafruit.com/magtag-tides-viewer?view=all - with the latest libraries of course BUT the HI / LO times do not show. I'm all new to this stuff but I found the HiLo times are being retrieved correctly but they are not displaying on the MagTag. Any ideas?

Adafruit Learning System

Download and display current day tide information.

lucid raptor
#

I don't have any idea off th etop of my head but I can test out that project as well in a bit to try to see whats up with it.

pliant mist
lucid raptor
pliant mist
#

@lucid raptor I'm not sure where to report this?

lucid raptor
#

If you're interested in getting more involved you could make the PR to fix it as well, we have a guide that can help you through that process if you do want to take it on. No worries if you'd rather not though I'll get it taken care of later today if no one gets to it sooner.

pliant mist
#

Thanks @lucid raptor .... I added an issue there with solution. Back to original problem: I tried those new libraries you gave me but it still does not disable the NeoPixel.

#

I'm using this code to test: ```import time
from adafruit_magtag.magtag import MagTag

magtag = MagTag()

button_colors = ((0, 255, 0), (255, 0, 0), (255, 255, 0), (0, 0, 255))
button_low_tones = (130.82, 146.83, 164.81, 174.61)
button_mid_tones = (261.63, 293.66, 329.63, 349.23)

while True:
print("Now enable the NeoPixels")
magtag.peripherals.neopixel_disable = False
#magtag.peripherals.neopixels[1].fill(button_colors[3])
magtag.peripherals.neopixels[0] = button_colors[0]
magtag.peripherals.neopixels[1] = button_colors[1]
magtag.peripherals.neopixels[2] = button_colors[2]
magtag.peripherals.neopixels[3] = button_colors[3]
time.sleep(2)
print("Now disable the NeoPixels")
magtag.peripherals.neopixel_disable = True
time.sleep(2) ```

lucid raptor
#

Maybe double check by deleting the adafruit_magtag library from your device and pasting in the one downloaded from that page.

I'm heading to a meeting in a moment but I'll try your code above afterward.

pliant mist
lucid raptor
#

No worries and Hooray, glad it's working correctly for you now. Thanks for reporting this issue about the neopixels as well as looking into and reporting that one for the tides project.

pliant mist
#

Great. I actually discovered the issue while running the MagTag Sports Schedule Viewer. I glad to say that is working now as expected Except the last line of text it is slightly chopped off https://learn.adafruit.com/assets/99739
The text "Game status: Final" is missing a pixel or two at the bottom. I'm using the stock standard code from the project. I'm assuming one of the libraries got updated and is the cause of the problem. Where would I report it? I have no idea how to debug this?

lucid raptor
#

You can make another issue on the Learn Guide repo for that one as well if you'd like. If you're able to snap a photo of your device with the text cut off and add that to the issue that would be great as well.

pliant mist
#

Will do - Thanks

lucid raptor
#

The position argument passed to add_text() there can have it's Y value lowered a little bit and it will scoot the text back upwards by that amount.