Skip to content

Instantly share code, notes, and snippets.

View acedrew's full-sized avatar

Andrew Rodgers acedrew

View GitHub Profile
@acedrew
acedrew / gist:0539e76ef1b7a1bcaefd32a99e36e0ae
Created December 25, 2023 22:30
RP2040 Light MPU based NeoPixel Controller
#include <Arduino.h>
#include <Adafruit_NeoPixel.h>
// #include <I2Cdev.h>
// #include <Wire.h>
#include <MPU6050_6Axis_MotionApps20.h>
// MPU Constants
#define I2C_SCL_PIN 13
#define I2C_SDA_PIN 12
#define MPU_PWR_PIN 15
@acedrew
acedrew / start-streaming.py
Created December 20, 2023 16:07
Streaming Audio Devices to an ESP32
import sounddevice as sd
import numpy as np
import requests
from monitorcontrol import get_monitors
from multiprocessing import Process
import socket
# seconds
MODULUS = 5
last_in_values = [0.0 for x in range(MODULUS)]
last_out_values = [0.0 for x in range(MODULUS)]
@acedrew
acedrew / gif_to_bin.py
Created November 3, 2020 17:45
Create 24bit frame buffer files from gif
from PIL import Image, ImageSequence
import numpy as np
import argparse
import os
def load_gif(filename: str):
return Image.open(filename)
def iterate_frames(img: Image):
return ImageSequence.Iterator(img)
@acedrew
acedrew / main.ino
Created October 25, 2020 19:57
GIF player for M5StickC
#include <M5StickC.h>
#include <SPIFFS.h>
#define BUTTON G37
bool loaded = false;
uint16_t buffer[12800];
uint8_t i = 7;
File dir;
File frame;
uint8_t current_gif = 0;
@acedrew
acedrew / gif_to_bin.py
Created October 25, 2020 19:55
Script to convert gif to 16bit pixel buffers for M5StickC Screen
from PIL import Image, ImageSequence
import numpy as np
import argparse
import os
def load_gif(filename: str):
return Image.open(filename)
def iterate_frames(img: Image):
return ImageSequence.Iterator(img)
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
{
"annotations": {
"list": []
},
"editable": true,
"gnetId": null,
"graphTooltip": 0,
"hideControls": false,
"id": 1,
"links": [],

Keybase proof

I hereby claim:

  • I am acedrew on github.
  • I am acedrew (https://keybase.io/acedrew) on keybase.
  • I have a public key whose fingerprint is 1690 57D0 2B52 E1D8 B149 8A64 3AA9 C552 1AD1 C54C

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am acedrew on github.
  • I am acedrew (https://keybase.io/acedrew) on keybase.
  • I have a public key whose fingerprint is 0B5D 5F42 C268 D35A 5ECF D586 E74F A11E AE1B C60F

To claim this, I am signing this object:

### My patterns
MYSYSLOGBASE %{SYSLOGTIMESTAMP:timestamp} %{WORD:logsource_host} %{SYSLOGHOST:logsource} %{SYSLOGPROG}: %{GREEDYDATA:syslog_message}
MYSYSLOGNGINX <%{NUMBER:syslog_pri}>%{MYSYSLOGBASE}
###Logstash.conf
input {
syslog {
type => syslog