Buttons, LEDs and rotary encoder
Connect and configure hardware buttons for playback and volume, lit buttons, the power LED and a volume rotary encoder on GPIO pins (BCM).
Under Hardware → Buttons you connect your own buttons, LEDs and a rotary encoder to the box. There is no fixed pin assignment – you enter the BCM numbers of the GPIOs you use.
Hardware buttons
With Enable hardware buttons five functions are available: play/pause, previous, next, volume up, volume down. Per button:
| Setting | Meaning |
|---|---|
| active | switch the button on or off |
| GPIO pin (BCM) | e.g. 22 for GPIO 22 (physical pin 15) |
| Pull | internal pull-up, pull-down or none |
| Active low | a press pulls the pin to ground (usual with pull-up) |
| Debounce (ms) | filters the bouncing of mechanical switches |
| LED | optional lighting of the button on its own pin |
Wiring (default): button between the GPIO pin and ground (GND), choose pull-up and active low in the admin interface. No extra resistor is needed then.
Power LED
Glows while MuPiBox is running. On the MuPiHAT+ BCM 13 (connector J15) is preset; pin and active low can be changed. Its brightness can follow the display (see Display & power); in standby it glows with the standby brightness.
If fan (BCM 12) and LED (BCM 13) are on hardware PWM (dtoverlay=pwm-2chan,pin=12,func=4,pin2=13,func2=4), the box dims smoothly; otherwise it only switches on and off.
Volume rotary encoder
A rotary encoder with two channels: CLK/A and DT/B to two free BCM GPIOs, the common terminal to ground.
| Setting | Meaning |
|---|---|
| CLK / A GPIO, DT / B GPIO | the two signal pins |
| Pull | usually pull-up |
| Debounce (ms) | keep it small (a few ms), otherwise detents get lost |
| Reverse direction | if turning right makes it quieter |
Turning changes the volume directly, limited by the maximum volume. A push button in the encoder can be entered as a normal button (e.g. play/pause).
Interactions
- A pin can belong to only one function; the admin interface rejects duplicate pins.
- The MuPiHAT pins (BCM 2, 3, 4, 17, with audio 16, 18, 19, 21) are off limits.
- The power button is not one of these buttons – it runs through the kernel, see MuPiHAT or the GPIO reference.
- Parental control applies to buttons too.