Skip to content

Instantly share code, notes, and snippets.

@savetheclocktower
savetheclocktower / README.md
Last active December 5, 2025 03:10
Using a rotary encoder as a volume control for the Raspberry Pi

Update on Nov 30, 2025: This Gist is nearly eight years old! These instructions worked back in 2018 for the Pi 3, but recent comments suggest that they may not be sufficient on more recent Pi models and newer versions of Raspberry Pi OS. Be advised.


Using a rotary encoder as a volume control

On my RetroPie machine I wanted a hardware volume knob — the games I play use a handful of emulators, and there's no unified software interface for controlling the volume. The speakers I got for my cabinet are great, but don't have their own hardware volume knob. So with a bunch of googling and trial and error, I figured out what I need to pull this off: a rotary encoder and a daemon that listens for the signals it sends.

Rotary encoder

@sophia-ooo
sophia-ooo / twitter.sh
Created January 1, 2016 04:45
twitter ffmpeg
ffmpeg -i test.mov -vcodec libx264 -vf 'scale=640:trunc(ow/a/2)*2' -acodec aac -vb 1024k -minrate 1024k -maxrate 1024k -bufsize 1024k -ar 44100 -strict experimental -r 30 out.mp4
@msmick
msmick / gist:6364475
Created August 28, 2013 10:14
autohotkey script for making middle mouse button drag the canvas in illustrator, emulating the spacebar action (simlar to many other software)
#IfWinActive ahk_class illustrator
MButton::
Send {Space Down}
Send {LButton Down}
KeyWait, MButton
Send {LButton Up}
Send {Space Up}
Return