Skip to content

Instantly share code, notes, and snippets.

View Gadgetoid's full-sized avatar
🚼
+1 Baby

Philip Howard Gadgetoid

🚼
+1 Baby
View GitHub Profile
from blinkt import set_pixel, clear, show
from time import localtime, sleep
MODE_HOUR = 0
MODE_MIN = 1
MODE_SEC = 2
time_to_stay_in_mode = 3
time_in_mode = 0
mode = 0
@Gadgetoid
Gadgetoid / asound.md
Last active August 21, 2020 15:02
Working asound.conf for libphatmeter on Volumio. Very hacky and still needs tweaks to mpd.conf and /dev/i2c-1 owned by group "audio" =/

This is a horrible, hacky, proof of concept mess for Pi VU Meter on Volumio It details steps with the old phatmeter library, but should work with PiVuMeter too, simply change "ameter" to "pivumeter" and link the right lib accordingly

udev rules permissions

REQUIRED: Create /etc/udev/rules.d/60-i2c.rules with the contents:

KEREL=="i2c-1", GROUP="i2C", MODE="0777"
@Gadgetoid
Gadgetoid / README.md
Last active September 4, 2019 17:23
VLC PHATBEAT Pirate Radio

Starting from Jessie or Jessie Lite

curl get.pimoroni.com/phatbeat | bash

Then install VLC:

sudo apt-get install vlc-nox
@Gadgetoid
Gadgetoid / __init__.py
Created July 7, 2017 09:47
Unicorn HAT HD - Dual Unicorn HAT
#!/usr/bin/env python
# NOTE! This file replaces __init__.py in the Unicorn HAT HD library and allows it to drive two displays side-by-side,
# in this configuration: https://twitter.com/Gadgetoid/status/883259931478155264
# Both HATs are connected to Mini Black HAT Hack3r boards- the right board is connected directly to the Pi, and the left
# board is wired to the GPIO outputs of the right using the standard UHHD pinout: https://pinout.xyz/pinout/unicorn_hat_hd
# MISO is not needed, and the chip-select pin is jumped from BCM7 on the right header to BCM8 on the left.
@Gadgetoid
Gadgetoid / README.md
Last active February 20, 2023 09:35
Raspberry Pi Zero / Windows 10 automatic RNDIS driver install for composite gadgets

Preface

I owe my very rapid learning journey in the world of ConfigFs to several key sources which aren't necessarily relevant to this result, but I feel deserve a mention anyway.

@Gadgetoid
Gadgetoid / main.py
Last active May 18, 2018 13:21
PiratePython: Scrollbot Web API
#!/usr/bin/env python
import scrollphathd
from scrollphathd.fonts import font5x7
from flask import Flask, request
import threading
import queue
import signal
import time
from zeroconf import ServiceInfo, Zeroconf
@Gadgetoid
Gadgetoid / __init__.py
Created January 10, 2018 09:55
Unicorn HAT HD - Multiple Display Driver
#!/usr/bin/env python
import colorsys
import time
import RPi.GPIO as GPIO
try:
import numpy
except ImportError:
@Gadgetoid
Gadgetoid / midi.py
Created March 12, 2018 16:10
Unicorn HAT HD MIDI fiddling. Using raw MIDI read from Python.
import unicornhathd
import time
from threading import Thread
import colorsys
MIDI_NOTE_OFF = 0x80
MIDI_NOTE_ON = 0x90
MIDI_AFTERTOUCH = 0xA0
MIDI_CC = 0xB0
MIDI_PATCH = 0xC0
@Gadgetoid
Gadgetoid / NaturewatchCameraServer.py
Created June 19, 2018 13:59
NaturewatchCameraServer with Button SHIM support
#!/usr/bin/env python
import json
import cv2
import os
import imutils
import buttonshim
from BaseHTTPServer import BaseHTTPRequestHandler, HTTPServer
from SocketServer import ThreadingMixIn
from ChangeDetector import ChangeDetector
import time
@Gadgetoid
Gadgetoid / led-matrix-5x5-dimension.svg
Created January 15, 2019 18:37
svg dimension for the Pimoroni 5x5 LED Matrix Breakout
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.