Skip to content

Instantly share code, notes, and snippets.

View jepler's full-sized avatar
💭
I may be slow to respond.

Jeff Epler jepler

💭
I may be slow to respond.
View GitHub Profile
import array
import time
import math
import audiosdl
import synthio
sine = array.array('h',
(int(math.sin(i * 2 * math.pi / 1024) * 32000) for i in range(1024)))
print(min(sine), max(sine))
import array
import time
import math
import audiosdl
import synthio
sine = array.array('h',
(int(math.sin(i * 2 * math.pi / 1024) * 32000) for i in range(1024)))
print(min(sine), max(sine))
import array
import time
import math
import audiosdl
import synthio
sine = array.array('h',
(int(math.sin(i * 2 * math.pi / 1024) * 32000) for i in range(1024)))
print(min(sine), max(sine))
OW = 249;
OH = OW;
pin_dx = 41;
pin_dy = 55;
screw_dy = 45;
screw_dx = 56;
aperture = 128 - 24;
import time
import subprocess
import contextlib
@contextlib.contextmanager
def TerminatingPopen(*args, **kw):
p = subprocess.Popen(*args, **kw)
try:
yield p
finally:
--- fbmirror_scaled_tmp.py.orig 2025-02-10 09:27:49.407999983 -0600
+++ fbmirror_scaled_tmp.py 2025-02-10 15:21:41.577745068 -0600
@@ -47,11 +47,12 @@
@click.option("--x-offset", "xoffset", type=int, help="The x offset of top left corner of the region to mirror", default=0)
@click.option("--y-offset", "yoffset", type=int, help="The y offset of top left corner of the region to mirror", default=0)
@click.option("--scale", "scale", type=int, help="The scale factor to reduce the display down by.", default=3)
-@piomatter_click.standard_options
-def main(xoffset, yoffset, scale, width, height, serpentine, rotation, colorspace, pinout, n_planes, n_addr_lines):
+@piomatter_click.standard_options(colorspace=None)
+def main(xoffset, yoffset, scale, width, height, serpentine, rotation, pinout, n_planes, n_addr_lines):
diff --git a/ports/raspberrypi/common-hal/microcontroller/__init__.c b/ports/raspberrypi/common-hal/microcontroller/__init__.c
index 7911c21e3c..971c1db9ef 100644
--- a/ports/raspberrypi/common-hal/microcontroller/__init__.c
+++ b/ports/raspberrypi/common-hal/microcontroller/__init__.c
@@ -23,11 +23,13 @@
#include "src/rp2_common/hardware_sync/include/hardware/sync.h"
#include "hardware/watchdog.h"
+#include "hardware/irq.h"
#!/usr/bin/python3
"""
Do framebuffer magic
Run like this:
$ python hub85_fb.py
The upper left corner of the framebuffer is displayed until the user hits ctrl-c
"""
from __future__ import annotations
import functools
from typing import Callable, ParamSpec, TypeVar, Generic
P = ParamSpec("P")
T = TypeVar("T")
class Recur(BaseException, Generic[P, T]):
f: Callable[P, T] | None
./api/1912/thermostat.png: 179858 0.8404265261111734
./api/755/interdisciplinary.png: 95303 0.7915005647465285
./api/1405/meteor.png: 71947 0.8293602305475505
./api/1523/microdrones.png: 145557 0.7931397122929381
./api/1743/coffee.png: 164902 0.7928857517898614
./api/881/probability.png: 158659 0.8246309771309771
./api/211/hamster_ball_heist.png: 282321 0.7975169491525423
./api/1672/women_on_20s.png: 320098 0.761557860677579
./api/2114/launch_conditions.png: 168211 0.8643047990956736
./api/2194/how_to_send_a_file.png: 256603 0.8247691412665812