I am trying to get a project up and running using the Yukon with a Dual Motor, Audio Amp and LED Module attached in Slots 1 to 3 respectively. I have the motor and amp working as I want, leaving what I thought would be the easiest module to last, as I have done a few projects using the Plasma2040.
However I can’t get the strip to light up in a single colour. I am think it is something simple but I can’t see it. Here is the test program
# ---------- Yukon Test Program 004a ----------
# Simplified to test LED Control first steps
import array
import time
import random
from pimoroni_yukon import Yukon, SLOT1, SLOT2, SLOT3
from pimoroni_yukon.modules import DualMotorModule,AudioAmpModule,LEDStripModule
from pimoroni_yukon.timing import ticks_ms, ticks_add
from machine import Timer, Pin, ADC
# --- LED Strip Set Up ---
STRIP_TYPE = LEDStripModule.NEOPIXEL # Define the strip type
STRIP_PIO = 0 # The PIO system to use (0 or 1) to drive the strip(s)
STRIP_SM = 0 # The State Machines (SM) to use to drive the strip(s)
LEDS_PER_STRIP = 53 # How many LEDs are on the strip. If using DUAL_NEOPIXEL this can be a single value or a list or tuple
BRIGHTNESS = 1.0 # The max brightness of the LEDs
# --- Yukon Setup, Verify and Enable ---
yukon = Yukon()
motor = DualMotorModule(25000)
amp = AudioAmpModule(0)
ledstrip = LEDStripModule(STRIP_TYPE,STRIP_PIO,STRIP_SM,LEDS_PER_STRIP,BRIGHTNESS)
yukon.register_with_slot(motor,SLOT1) # Register the DualMotorModule object with the Slot 1
yukon.register_with_slot(amp,SLOT2) # Register the AudioAmpModule object with the Slot 2
yukon.register_with_slot(ledstrip,SLOT3) # Register the LEDModule object with the Slot 3
yukon.verify_and_initialise() # Verify and initialise the modules
yukon.enable_main_output() # Turn on power to the module slots
motor.enable() # Enable the motor driver on the DualMotorModule
amp.enable() # Enable the audio amp
ledstrip.enable() # Enable the led strip
while True:
for led in range(ledstrip.strip.num_leds()):
# Set all leds to the same colour
ledstrip.strip.set_rgb(led, 255, 255, 255)
# Send the new colours to the LED strip
ledstrip.strip.update()
time.sleep(5)
# xxxxx End While xxxxxx
And the thonny shell
MPY: soft reboot
> Running Yukon 1.0.2, MicroPython 17d8234-dirty on 2024-09-27
> Checking output voltage ...
> Verifying modules
[Slot1] 'Dual Motor' module detected and registered.
[Slot2] 'Audio Amp' module detected and registered.
[Slot3] 'LED Strip (NeoPixel)' module detected and registered.
[Slot4] Module slot is empty.
[Slot5] Module slot is empty.
[Slot6] Module slot is empty.
> Initialising modules
[Slot1 'Dual Motor'] Initialising ... [Slot1 'Dual Motor'] Current limit set to 0.444A
done
[Slot2 'Audio Amp'] Initialising ... done
[Slot3 'LED Strip (NeoPixel)'] Initialising ... done
> Checking input voltage ...
> Enabling output ...
> Output enabled
Removed the two other modules and tried the example code and all works fine so the LEDs are fine but something defiantly wrong with my understanding of how to use multiple modules.
Thanks for your help :)