Skip to content

Instantly share code, notes, and snippets.

@chrisstubbs93
chrisstubbs93 / GxGDEH029A1.cpp
Created Apr 13, 2019
GxGDEH029A1.cpp from GxEPD modified to dump every screen update over the serial port in XPM2 format (save as .xmp without <<< >>> tags and open in GIMP)
View GxGDEH029A1.cpp
// class GxGDEH029A1 : Display class for GDEH029A1 e-Paper from Dalian Good Display Co., Ltd.: www.good-display.com
//
// based on Demo Example from Good Display, available here: http://www.good-display.com/download_detail/downloadsId=515.html
// Controller: IL3820 : http://www.good-display.com/download_detail/downloadsId=540.html
//
// Author : J-M Zingg
//
// Version : see library.properties
//
// License: GNU GENERAL PUBLIC LICENSE V3, see LICENSE
@chrisstubbs93
chrisstubbs93 / TCA9548A.ino
Created Dec 27, 2018
TCA9548A set and check multiplexer bus for arduino
View TCA9548A.ino
#include <Wire.h>
#define TCAADDR 0x70
void setup() {
Wire.begin();
Serial.begin(115200);
}
void loop() {
for (int bus = 0; bus <= 7; bus++) {
@chrisstubbs93
chrisstubbs93 / motors.py
Created Sep 19, 2018
Python Websockets server for motor control on Pi GPIO
View motors.py
import socket, hashlib, base64, threading
import RPi.GPIO as GPIO
import time
from collections import namedtuple
from functools import wraps
import threading
from threading import Timer
from functools import partial
@chrisstubbs93
chrisstubbs93 / ffmpeg.sh
Last active Feb 9, 2021
auto-restart FFMPEG when it stops sending frames to youtube
View ffmpeg.sh
#!/bin/sh
sleep 5
ffmpeg -re -f mjpeg -r 10 -i "http://localhost/?action=stream" -ar 44100 -ac 2 -acodec pcm_s16le -f s16le -ac 2 -i /dev/zero -acodec aac -ab 1k -strict experimental -s 640x360 -vcodec h264 -pix_fmt yuv420p -g 20 -vb 500k -preset ultrafast -crf 31 -r 10 -f flv "rtmp://a.rtmp.youtube.com/live2/xxxx-xxxx-xxxx-xxxx" 2> /home/pi/ffmpeg.log