#Neradoc 2644 On reset the light flashes
1 messages ยท Page 1 of 1 (latest)
ok so that's the bootloader followed by the safe mode blink, followed by an exception that happened when it ran the code
if you have the CIRCUITPY drive, what is in code.py ?
Code.py is the initial program given: # SPDX-FileCopyrightText: 2021 Kattni Rembor for Adafruit Industries
SPDX-License-Identifier: MIT
"""CircuitPython blink example for built-in NeoPixel LED"""
import time
import board
import neopixel
pixel = neopixel.NeoPixel(board.NEOPIXEL, 1)
while True:
pixel.fill((0, 255, 0))
time.sleep(0.5)
pixel.fill((0, 0, 0))
time.sleep(0.5)
Oh I change the color to green too
aha did you install the neopixel library ?
from the bundle's lib directory to the board's lib directory
so red blink means error, green means "code finished", yellow means "safe mode" (not executing user code)
(every 5 seconds)
and if your code is running, it's your code that controls the LED
Wait, there are 2 libraries in lib: adafruit_pixelbuf.mpy and neopixel.mpy.
Now on pushing the reset button windows wants to repair the CIRCUITPY (:F) drive
yeah it's better to eject the drive first if you reset
usually it's nothing unless it resets while you are saving, like within 1 minute of it, though some software might touch the drive (which you would notice if the code resets for no reason)
pixelbuf if not necessary, it's a dependency for some small (flash size) boards, most have it built into Circuitpython now
(it doesn't hurt though so it's fine either way)
When making a change in Mu I expect it to make the board flash yellow like it's loading something, but that never happens with this QT-PY
when you save, the code just restarts, it shouldn't flash unless your code does the flashing
It looks like my code never runs. No matter what color I program, it continues to double blink red.
do you have access to the Mu serial console ?
Yes, it has nothing on it.
if you click on it and hit ctrl-C then ctrl-D, what happens ?
Nothing happens
No serial output
maybe that version of Mu doesn't capture the serial correctly ?
downloading updated mu...
also press reset on the board just in case (after ejecting)
BTW the Mu loading screen is animated and funny
Updated Mu serial is working. It's repeating Hello ๐
ok, now back to the original code and see if it complains
Look at that, the program calls for green but the board double blinks red.
and there is no serial output
the serial output, ctrl-C ctrl-D
ctrl-C should get you the REPL prompt >>>
and ctrl-D restart the code
The serial window still shows the repeated hellos
can you hit ctrl-C there ?
I can, but nothing changes
I had the hellos print a little fast, it might make the serial unresponsive, just make sure that code.py does not contain that loop again and restart Mu maybe
(I would normally add a sleep, but that was just a quick test for the serial console)
Restarted Mu, Serial shows: Traceback (most recent call last):
File "code.py", line 6, in <module>
MpyError: Incompatible .mpy file. Please update all .mpy files. See http://adafru.it/mpy-update for more info.
Code done running.
AHA !
Bad library?
progress !
so make sure to delete the libraries and install the correct files from the bundle
I deleted the libraries in the CIRCUITPY (F:) lib folder but I don't know how to install the correct files or where the bundle is.
the bundle is here https://circuitpython.org/libraries
you take adafruit-circuitpython-bundle-8.x-mpy-20230113.zip , unzip, and copy neopixel.mpy from the lib directory to your board's lib directory