Here's a minimal program to test. After the program completes, pixel[0] will periodically turn on (red) and then off. Sometimes it flashes. Sometimes it stays on for 4+/- seconds. Sometimes I've see it flash green-ish or blue-ish. Is this normal behavior?
My goal is that when code.py on the MacroPad finishes and the "code done running" message is displayed on the OLED, then the MacroPad pixel[0] shouldn't randomly flash. If pixel[0] is off at the time the code finishes, then it should stay off and not blink.
The two statements you gave have no effect on the blinking when those statements are included in code.py. (I wouldn't have expected them to have any effect since "code done running" suggest to me that the MacroPad should be behaving like an electric brick at that point.)
Based on those statements, I thought perhaps that the blinking was being caused by the MacroPad doing some sort of check to see if the laptop was trying to transfer new code, but the blinking still occurs when the MacroPad is plugged into a dump USB charging port on my workbench.
Which version of CircuitPython are you running on your macropad? I think it might be worth trying the current 7.0.0-alpha5 if you are not already on it with the current 7.x libraries to see if that changes the idle behavior.
Great. Glad to see the CircuitPython is current. If you have not already can you replace any of the contents of /lib with the 20210806 7.x library bundle?
The following is a listing of the files in the lib directory after having copied new versions of whatever was there already with a version from /adafruit-circuitpython-bundle-7.x-mpy-20210806.
pixel[0] still flashes, but this time, it's blue. Previously, I've seen red and green.
Aug 6 05:10 adafruit_debouncer.mpy*
Aug 9 18:47 adafruit_display_shapes/
Aug 9 18:47 adafruit_display_text/
Aug 9 18:47 adafruit_hid/
Aug 6 05:10 adafruit_macropad.mpy*
Aug 9 18:47 adafruit_midi/
Aug 6 05:10 adafruit_pixelbuf.mpy*
Aug 6 05:10 adafruit_simple_text_display.mpy*
Aug 6 05:10 neopixel.mpy*
When you look at the serial console in the mu do you see any output from the REPL besides "Code done running" or is that the same?
If you do the reverse and leave the macropad running doing nothing does this stop the random flashing? I am not suggesting this is a solution to sitting idle without blinking, but would like to know if it exhibits the correct behavior.
Would you like to open an issue on the github report for CircuitPython? This seems like the a settings that others would appreciate that the default state of the macropad be off until code is being executed. It might be declines, but seems reasonable to request.
I will post an issue on GitHub. Can you first confirm that the behavior that I see is what everyone sees and that it’s not a hardware/assembly issue that I’m dealing with?
I have a high confidence that the behavior you are seeing is normal, but never having used a macropad I'm not 100%. Opening an issue and letting hearing from the mainters about the design choice to have default on lillumination would be helpful and if that was not the case we will find out quickly.
Well, apparently the flashing is desired and expected based on the Issue filed on GitHub:
The first NeoPixel is used as a status pixel, like the status NeoPixels on Feather and Metro boards. If your program starts using the NeoPixels, the status information will not be displayed. Normally your user program would run forever, but if it completes, CircuitPython restart and will again display status information.
Yes, the status RGB LED indicates various states and errors. In 6.x and earlier, it flashed more often: https://learn.adafruit.com/welcome-to-c ... 2978455-21. In 7.0.0, we are simplifying it and reducing the frequency of flashing, to save power and annoyance. The new flashing scheme hasn't been written up yet in detail.
Thank you for the summary of that issue. It sounds like it will be less annoying, but still blinking status information in the future if the code completes.