Skip to content

Instantly share code, notes, and snippets.

@Pigankle
Pigankle / mixPhone.py
Last active March 10, 2017 01:18
Turn a rotary dial phone into an mp3 mixtape, with each number corresponding to one track, except for 8, which plays a random track (Magic 8-Ball). When the phone is on cradle, dialing a number sets the volume. Thanks to simonjenny, of the Fairytale Phone project, (https://gist.github.com/simonjenny/8d6c29db8b8a995a4d89) for the basic approach.
#!/usr/bin/python3
import RPi.GPIO as GPIO
import math, sys, os
import subprocess
import socket
import glob
#Global setting to control whether random play plays on.
#Set GPIO Pin Behavior