Skip to content

Instantly share code, notes, and snippets.

@helgibbons
helgibbons / mopidy-spotify.md
Last active May 14, 2025 10:47
How to get mopidy-spotify working in 2025

I started from the most recent version of Raspberry Pi OS (with recommended software) on a Pi Zero 2 W.

Installing Mopidy

First install the repackaged installer from pimoroni/pirate-audio#105. This is now merged into main so you can install it with

git clone https://github.com/pimoroni/pirate-audio
cd pirate-audio/mopidy
./install.sh
@helgibbons
helgibbons / battery.py
Created October 6, 2025 09:43
Read system voltage on Pico W and estimate battery percentage
full_battery = 4.2
empty_battery = 2.8
def get_vsys():
# Pico W voltage read function by darconeous on reddit:
# https://www.reddit.com/r/raspberrypipico/comments/xalach/comment/ipigfzu/
conversion_factor = 3 * 3.3 / 65535
import network
from machine import Pin, ADC
wlan = network.WLAN(network.STA_IF)
@helgibbons
helgibbons / comic.py
Last active December 2, 2025 13:11
Attempt to work around Comic Vine's new Cloudflare shenanigans
"""
Python script to fetch a randomised comic cover from the Comic Vine API and show it on an Inky Impression display.
You will need to sign up for an API key at https://comicvine.gamespot.com/api/ to use this script.
Change the search query to the comic series you want to display!
"""
import json
import random
import time
from io import BytesIO