This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// simple "HTTP by hand" in ESP-IDF | |
// add "REQUIRES esp_wifi esp_netif nvs_flash" to CMakeLists.txt | |
#include <string.h> | |
#include <sys/socket.h> | |
#include <netdb.h> // getaddrinfo() | |
#include "esp_wifi.h" | |
#include "esp_event.h" | |
#include "esp_log.h" | |
#include "nvs_flash.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Default server configuration | |
# | |
server { | |
listen 80 default_server; | |
listen [::]:80 default_server; | |
root /var/www/html; | |
# Add index.php to the list if you are using PHP | |
index index.php index.html index.htm index.nginx-debian.html; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# circuitpython_font_play_code_simple.py -- playing w adafruit circuitpython-fonts | |
# 8 Aug 2025 - @todbot / Tod Kurt | |
# developed on a Lilygo T-Display S3 w/ ST7789 display in paralleldisplaybus mode | |
# To use this, first install 'circup' and do what's described here: | |
# https://github.com/adafruit/circuitpython-fonts/ | |
# e.g.: | |
# circup bundle-add adafruit/circuitpython-fonts # You only need to do this once | |
# circup show | grep 48 | grep font # find fonts that are size 48 | |
# circup install font_... # find a font you like & install it, like: | |
# circup install font_raleway_medium_48 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# | |
# kicad-diff-pcb -- Git diff for Kicad PCB layouts | |
# 22 Jul 2025 - @todbot / Tod Kurt | |
# | |
# Install steps: | |
# 1. Make sure `kicad-cli` is in your PATH | |
# 2. Save this file somewhere in your PATH, I prefer "~/bin" | |
# 3. Make this script executable: "chmod +x kicad-diff-pcb" | |
# 4. Add the following to your ~/.gitconfig |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# espnow-simple_hacky_receiver.py -- show ESPnow working broadcast on CircuitPython | |
# 9 Jul 2025 - @todbot | |
# tested on QTPY ESP32-S2 and FunHouse (ESP32-S2) | |
import time | |
import wifi | |
import espnow | |
# https://github.com/adafruit/circuitpython/issues/9380#issuecomment-2463013607 | |
# hack to switch channel that is used for ESPNow | |
# this takes just a few milliseconds, so doesn't waste a lot of power |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Find all the defined pins for a CircuitPython board | |
# 5 Jul 2025 - @todbot / Tod Kurt | |
# e.g. "cirpy-showpins.py qtpy_m0 ~/projects/adafruit/circuitpython" | |
# Note: you need a checkout of the CircuitPython github repo for this tool to work | |
# e.g. "mkdir -f ~/projects/adafruit && cd ~/projects/adafruit && git checkout https://github.com/adafruit/circuitpython/" | |
import os, sys, re | |
if len(sys.argv) <= 1: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
import board | |
import audiocore, audiobusio, audiomixer | |
SAMPLE_RATE = 44100 | |
BUFFER_SIZE = 2048 | |
CHANNEL_COUNT = 2 | |
i2s_bck_pin = board.GP20 | |
i2s_lck_pin = board.GP21 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
# Original data points | |
x_vals = np.array([-0.5, -23.6, -58.3]) | |
y_vals = np.array([1, 47, 110]) | |
# Linear regression (best-fit line) | |
coeffs = np.polyfit(x_vals, y_vals, 1) | |
linear_fit = coeffs[0] * x_vals + coeffs[1] |
NewerOlder