Skip to content

Instantly share code, notes, and snippets.

Avatar
🚼
+1 Baby

Philip Howard Gadgetoid

🚼
+1 Baby
View GitHub Profile
View Makefile
CFLAGS_ALL=-I../libusbgx/build/include -I../bcm2835-1.68/build/include -L../bcm2835-1.68/build/lib -I../lua-5.4.0/src -L../libusbgx/build/lib -L../libserialport/build/lib -L../lua-5.4.0/src -lpng -lz -lpthread -llua -lm -lbcm2835 -ldl
pi400: CFLAGS+=-static $(CFLAGS_ALL) -lusbgx -lconfig -DPI400_USB
pi400: pi400.c gadget-hid.c
$(CC) $^ $(CFLAGS) -o $@
pi400test: CFLAGS+=-static $(CFLAGS_ALL) -lusbgx -lconfig
pi400test: pi400.c gadget-hid.c
$(CC) $^ $(CFLAGS) -o $@
@Gadgetoid
Gadgetoid / 10-twinkie.rules
Created Feb 6, 2019
Script to build Sigrok and PulseView on the Raspberry Pi with Twinkie USB Power-Delivery sniffer support
View 10-twinkie.rules
SUBSYSTEMS=="usb", ATTRS{idVendor}=="18d1", ATTRS{idProduct}=="500a", MODE="0660", GROUP="dialout"
@Gadgetoid
Gadgetoid / midi-sequencer.orca
Created Jan 21, 2019
Simple non-regular step chord sequencer in ORCA.
View midi-sequencer.orca
.........................................................................
.U.......................................................................
....W.U..................................................................
.S.......................................................................
.........................................................................
.........................................................................
.........................................................................
.....NYNYNYNYNYNYNYNYNYNYNYNYNYNYNYNYNYN11G0.............................
......Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.Y.01G1.............................
.S.......J...........J...........J...J.J..0....................2V1.......
@Gadgetoid
Gadgetoid / led-matrix-5x5-dimension.svg
Created Jan 15, 2019
svg dimension for the Pimoroni 5x5 LED Matrix Breakout
View led-matrix-5x5-dimension.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Gadgetoid
Gadgetoid / NaturewatchCameraServer.py
Created Jun 19, 2018
NaturewatchCameraServer with Button SHIM support
View NaturewatchCameraServer.py
#!/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 / midi.py
Created Mar 12, 2018
Unicorn HAT HD MIDI fiddling. Using raw MIDI read from Python.
View midi.py
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 / __init__.py
Created Jan 10, 2018
Unicorn HAT HD - Multiple Display Driver
View __init__.py
#!/usr/bin/env python
import colorsys
import time
import RPi.GPIO as GPIO
try:
import numpy
except ImportError:
@Gadgetoid
Gadgetoid / main.py
Last active May 18, 2018
PiratePython: Scrollbot Web API
View main.py
#!/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 / README.md
Last active Apr 29, 2022
Raspberry Pi Zero / Windows 10 automatic RNDIS driver install for composite gadgets
View README.md

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 / __init__.py
Created Jul 7, 2017
Unicorn HAT HD - Dual Unicorn HAT
View __init__.py
#!/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.