From 4fd9e1b3e9467670b9af9d76f47cdacf18a93951 Mon Sep 17 00:00:00 2001 From: Dejvino Date: Fri, 20 Feb 2026 07:13:16 +0100 Subject: [PATCH] Fix neopixel flickering --- README.md | 12 +++++++++--- UIManager.cpp | 3 ++- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ba3b60b..ae2b67f 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ Make sure to establish a **common ground** by connecting the ground from your ex | DT | GP13 (Pin 17) | Encoder Data | | SW | GP14 (Pin 19) | Encoder Switch | | **WS2812B 8x8 Matrix**| | | -| DIN (Data In) | GP16 (Pin 21) | NeoPixel Data | +| DIN (Data In) | GP2 (Pin 4) | NeoPixel Data | | 5V / VCC | External 5V Supply `+` | **External 5V Power** | | GND | External 5V Supply `-` | **External Power Ground** | | | GND (Pin 18) | **Common Ground with Pico** | @@ -50,7 +50,7 @@ Make sure to establish a **common ground** by connecting the ground from your ex | TX (MIDI OUT) | GP0 (Pin 1) | To DIN Pin 5 (via 220Ω) | **MIDI Hardware Note**: -* **MIDI OUT**: Connect **GP0** to DIN Pin 5 via a 220Ω resistor. Connect DIN Pin 4 to +5V via a 220Ω resistor. Connect DIN Pin 2 to GND. +* **MIDI OUT**: Connect **GP0** to DIN Pin 5 via a 220Ω resistor. Connect DIN Pin 4 to 3.3V (3V3) via a 220Ω resistor. Connect DIN Pin 2 to GND. Once everything is wired up, you can upload the code and your tracker should be ready to go! @@ -91,4 +91,10 @@ For a more integrated build that can fit inside an enclosure, you can use a Lith * **Navigation**: Rotate the encoder to move between steps. * **Edit Mode**: Short press the encoder button to toggle Edit Mode. Rotate to change the note. * **Playback**: Long press the encoder button (> 0.6s) to Start/Stop playback. -* **MIDI**: The device sends MIDI notes via the Hardware Serial (DIN) port on GP0. \ No newline at end of file +* **MIDI**: The device sends MIDI notes via the Hardware Serial (DIN) port on GP0. + +## Troubleshooting +- NeoPixel LEDs randomly lighting full bright white? Try a different pin. E.g. pin 16 has some noise that messes with the precise timing of the NeoPixel. +- MIDI signal not accepted by a device? Check that you're using 3.3V and not 5V. Some devices accept it, others don't. MIDI uses 3V3. +- Device freezing and restarting? Watchdog detected a deadlock and restarted the system. Check for `midi.lock()` & `midi.unlock()` called *exactly once* one after another. Calling lock twice causes a deadlock. +- NeoPixel not lighting up? Connect it to an external power source strong enough to drive 3A. Don't power it directly from the Pico. diff --git a/UIManager.cpp b/UIManager.cpp index 4a48194..991a1ce 100644 --- a/UIManager.cpp +++ b/UIManager.cpp @@ -7,7 +7,7 @@ #define SCREEN_HEIGHT 64 #define OLED_RESET -1 #define SCREEN_ADDRESS 0x3C -#define PIN_NEOPIXEL 16 +#define PIN_NEOPIXEL 2 #define NUM_PIXELS 64 UIManager ui; @@ -29,6 +29,7 @@ void UIManager::begin() { display.display(); // Setup NeoPixel Matrix + pixels.setPin(PIN_NEOPIXEL); pixels.begin(); pixels.setBrightness(40); pixels.clear();