We are using the LumiDrive in a low powered field instrument to control a 2 inch LuMini ring. When we power-up the LumiDrive via a MOSFET switching circuit (to enable low power - signal sent via a RPi), sometimes it lights the Lumni ring and at other times, it does not (but the board is powered). The LumiDrive is powered by 3.7V (three D-cells in series).
Hitting the reset switch fixes this when the LEDs fail to light-up. I have tried adding a supervisor.reload() to the boot.py, but this does not resolve the problem. I have also tried microcontroller.reset() in the boot.py, but cannot workout how to then get it to load the main.py. Any advice is gratefully received.
Boot.py
import supervisor
import microcontroller
import time
#microcontroller.on_next_reset(microcontroller.RunMode.NORMAL)
#microcontroller.reset()
supervisor.reload()
time.sleep(1)
Main.py:
# LED control board with switching.
# See https://github.com/sparkfun/SparkFun_LumiDrive_Example_Code
# Switch uses RPi GPIO signal.
import adafruit_dotstar # The LED library
import math
import time
import board
import digitalio
# Set up light parameters.
num_pixels = 40 # 3" ring has 60, 2" ring has 40, the 1" ring has 20
brightness = 0.1 # 10 % brightness. Avoid running close to 100 % to avoid LED damage
# This creates the instance of the DoTStar library.
pixels = adafruit_dotstar.DotStar(board.SCK, board.MOSI,
num_pixels, brightness=brightness, auto_write=False)
# Define light colours in RGB
BLACK = (0, 0, 0)
WHITE = (255, 255, 255)
# This function takes a color and a delay and fills the entire strand with that color.
# The delay is given in the case you use multiple color fills in a row.
def color_fill(color, wait):
pixels.fill(color)
pixels.show()
time.sleep(wait)
# Continuous loop monitoring pin9 and illuminating LED when HIGH.
color_fill(WHITE,10)