Fix neopixel flickering

This commit is contained in:
Dejvino 2026-02-20 07:13:16 +01:00
parent 46ecc57cde
commit 4fd9e1b3e9
2 changed files with 11 additions and 4 deletions

View File

@ -42,7 +42,7 @@ Make sure to establish a **common ground** by connecting the ground from your ex
| DT | GP13 (Pin 17) | Encoder Data | | DT | GP13 (Pin 17) | Encoder Data |
| SW | GP14 (Pin 19) | Encoder Switch | | SW | GP14 (Pin 19) | Encoder Switch |
| **WS2812B 8x8 Matrix**| | | | **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** | | 5V / VCC | External 5V Supply `+` | **External 5V Power** |
| GND | External 5V Supply `-` | **External Power Ground** | | GND | External 5V Supply `-` | **External Power Ground** |
| | GND (Pin 18) | **Common Ground with Pico** | | | 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Ω) | | TX (MIDI OUT) | GP0 (Pin 1) | To DIN Pin 5 (via 220Ω) |
**MIDI Hardware Note**: **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! 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. * **Navigation**: Rotate the encoder to move between steps.
* **Edit Mode**: Short press the encoder button to toggle Edit Mode. Rotate to change the note. * **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. * **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. * **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.

View File

@ -7,7 +7,7 @@
#define SCREEN_HEIGHT 64 #define SCREEN_HEIGHT 64
#define OLED_RESET -1 #define OLED_RESET -1
#define SCREEN_ADDRESS 0x3C #define SCREEN_ADDRESS 0x3C
#define PIN_NEOPIXEL 16 #define PIN_NEOPIXEL 2
#define NUM_PIXELS 64 #define NUM_PIXELS 64
UIManager ui; UIManager ui;
@ -29,6 +29,7 @@ void UIManager::begin() {
display.display(); display.display();
// Setup NeoPixel Matrix // Setup NeoPixel Matrix
pixels.setPin(PIN_NEOPIXEL);
pixels.begin(); pixels.begin();
pixels.setBrightness(40); pixels.setBrightness(40);
pixels.clear(); pixels.clear();