BT connection WIP

This commit is contained in:
Dejvino
2026-02-16 00:48:05 +01:00
parent 2ed1467122
commit 7c9df501a7
2 changed files with 384 additions and 10 deletions
+54 -4
View File
@@ -1,6 +1,17 @@
# RP2040 MIDI Tracker
A simple MIDI step sequencer using a Raspberry Pi Pico, an OLED display, a rotary encoder, and an 8x8 NeoPixel matrix.
A simple MIDI step sequencer using a Raspberry Pi Pico W, an OLED display, a rotary encoder, and an 8x8 NeoPixel matrix.
## Software Requirements
* **Board Core**: This project uses the **Raspberry Pi Pico/RP2040** core by **Earle F. Philhower, III**.
1. Add this URL to your Additional Boards Manager URLs in Preferences:
`https://github.com/earlephilhower/arduino-pico/releases/download/global/package_rp2040_index.json`
2. Go to **Tools > Board > Boards Manager**, search for **"pico"**, and install **Raspberry Pi Pico/RP2040**.
3. Select **Raspberry Pi Pico W** from the board menu.
* **Libraries**: Install via Library Manager:
* `Adafruit GFX Library`, `Adafruit SSD1306`, `Adafruit NeoPixel`
* *(Note: `ArduinoBLE` is NO LONGER required. We use the built-in BTStack)*
## Connections & Wiring
@@ -9,10 +20,10 @@ Properly wiring the components is crucial, especially for power.
### Power
The project is best powered in two parts:
1. **Raspberry Pi Pico**: Power the Pico via its Micro-USB port from a computer or a USB wall adapter.
1. **Raspberry Pi Pico W**: Power the Pico via its Micro-USB port from a computer or a USB wall adapter.
2. **NeoPixel 8x8 Matrix**: This component is power-hungry and **requires a separate, external 5V power supply**. A power supply capable of delivering at least 2A is recommended.
> **WARNING**: Do NOT power the NeoPixel matrix from the Pico's 3.3V or VBUS pins. Doing so can draw too much current and damage your Pico and/or the host computer's USB port.
> **WARNING**: Do NOT power the NeoPixel matrix from the Pico's 3.3V or VBUS pins. VBUS is connected directly to the USB port, which is typically limited to 500mA. The matrix can draw over 2A, which could overload and damage your host computer's USB port.
### Component Wiring
@@ -37,4 +48,43 @@ Make sure to establish a **common ground** by connecting the ground from your ex
| GND | External 5V Supply `-` | **External Power Ground** |
| | GND (Pin 18) | **Common Ground with Pico** |
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!
## Making it Portable
To run this project without being tethered to a computer, you'll need a portable power source that can supply both the Pico and the power-hungry NeoPixel matrix.
### Option 1: Using a USB Power Bank (Easiest)
This is the simplest and safest method.
* **What you'll need:** A standard USB power bank with at least two outputs, capable of supplying a total of 2.5A or more.
* **Pico Power:** Connect a standard Micro-USB cable from one of the power bank's outputs to the Pico's USB port.
* **Matrix Power:** Use a second USB cable to power the NeoPixel matrix. You will likely need to cut the end of a USB cable and connect the 5V (usually red) and GND (usually black) wires to the matrix's power input.
* **Common Ground:** The common ground is handled automatically through the USB connections to the same power bank. However, it is still best practice to run a dedicated wire from the matrix's GND to one of the Pico's GND pins.
### Option 2: LiPo Battery with a 5V Booster (More Compact)
For a more integrated build that can fit inside an enclosure, you can use a Lithium Polymer (LiPo) battery and a voltage-boosting board.
* **What you'll need:**
* A single-cell (3.7V) LiPo battery.
* A 5V booster board, such as the Adafruit PowerBoost 1000C. These boards can charge the LiPo battery and provide a stable 5V output.
> **LIPO BATTERY WARNING**: LiPo batteries are powerful but require careful handling.
> * **Never** use a LiPo battery without a dedicated protection circuit, which prevents over-charge, over-discharge, and short-circuits. Boards like the PowerBoost series have this built-in.
> * Do not puncture, bend, or short-circuit a LiPo battery.
> * Always charge them with a proper LiPo charger.
* **Wiring:**
1. Connect the **LiPo battery** to the battery input terminals on the **PowerBoost board**.
2. Connect the **PowerBoost's 5V output** to the **NeoPixel Matrix's 5V/VCC input**.
3. Connect the **PowerBoost's 5V output** to the **Pico's VBUS pin (Pin 40)**. This will power the Pico.
4. Connect the **PowerBoost's GND** to **both** the **NeoPixel Matrix's GND** and one of the **Pico's GND pins**. This creates the essential common ground.
## Usage
* **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.
* **Bluetooth**: The device advertises as "RP2040 Tracker". Connect to it from your computer or MIDI Bluetooth dongle.