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
@Gadgetoid
Gadgetoid / Makefile
Last active August 25, 2023 01:50
Pi 400 KB
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 / README.md
Last active February 20, 2023 09:35
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 / 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" =/
View asound.md

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
View README.md

Starting from Jessie or Jessie Lite

curl get.pimoroni.com/phatbeat | bash

Then install VLC:

sudo apt-get install vlc-nox
@Gadgetoid
Gadgetoid / 10-twinkie.rules
Created February 6, 2019 18:59
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 January 21, 2019 21:36
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 January 15, 2019 18:37
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 June 19, 2018 13:59
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 / ExplorerHat.md
Last active May 31, 2018 22:45
Explorer HAT, Motors, Steppers and Servos
View ExplorerHat.md

#Explorer HAT Pro, Motors, Servos and Steppers

Find this Gist at: tiny.cc/explorerhat

The Motor driver on Explorer HAT Pro can not only drive motors, but a stepper motor too. And just like the Pibrella the outputs can also drive a motor or four, or another stepper.

Explorer HATs outputs sink to ground, meaning that you need to connect whatever you're driving between 5V and the output

#MOTORS

@Gadgetoid
Gadgetoid / main.py
Last active May 18, 2018 13:21
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