Skip to content

Instantly share code, notes, and snippets.

#include <Wire.h>
#include <Bluepad32.h>
#include <SensorFusion.h>
#include <Adafruit_NeoPixel.h>
#include <AudioTools.h>
#include <AudioTools/AudioLibs/Concurrency.h>
#include <SparkFun_LSM6DSV16X.h>
#include <ESP32Servo.h>
#include <ESP32PWM.h>
#include <Preferences.h>
#ifndef ARDUINO_ARCH_ESP32
#error "only works on ESP32"
#endif
#if !__has_include("Bluepad32.h")
#error "Need to use esp32_bluepad32 core, installation instructions here: https://bluepad32.readthedocs.io/en/latest/plat_arduino/"
#endif
#include <Bluepad32.h>
ControllerPtr myController;
[
[
[,0,220,,.08,.6,3,0,,,,,,,,,,.5,.1],
[2,0,55,,,.48,2,,,,,,,,,.02,.01,.5,.1],
[2,0,660,,,.09,3,,,,,,.2,2,,,,1.1],
[4,0,80,,,.2,1,4,-2,6,50,.15,,6],
[,0,220,,.08,.6,2,,,,,,,,,,,.5,.1],
[,0,3520,,,.11,3,1.65,,,,,,2]
],
[
@dragoncoder047
dragoncoder047 / uLisp_Thoughts.hpp
Created January 20, 2024 20:15
[incomplete/uncompileable] Proposal for the next version of uLisp (http://ulisp.com)
typedef const struct typetbl_entry typetbl_entry_t;
typedef const struct streamtbl_entry streamtbl_entry_t;
typedef struct sobject {
union {
struct {
sobject* car;
sobject* cdr;
};
struct {
@dragoncoder047
dragoncoder047 / the fours have it.py
Last active March 22, 2024 14:38
Program to find all the solutions to the "The Fours Have It" math worksheet
## Well, almost all of them. There are solutions for 13 but this doesn't find those for some odd reason
import sys
def sqrt(x):
try:
return {169: 13, 144: 12, 121: 11, 100: 10, 81: 9,
64: 8, 49: 7, 36: 6, 25: 5, 16: 4, 9: 3, 4: 2}[x]
except KeyError:
raise ValueError("don't want floats") from None
@dragoncoder047
dragoncoder047 / sblock.html
Created December 16, 2023 23:23
Block-based Scheme editor prototype layout
<style>
/*
SBlock Prototype CSS
*/
.pre {
white-space: pre-wrap;
}
.sblock {
display: inline-block;
color: var(--sblock-txt-color);
@dragoncoder047
dragoncoder047 / 10PRINT.html
Created October 7, 2023 20:46
10 PRINT CHR$(205.5+RND(1)); : GOTO HTML
<pre>10 PRINT CHR$(205.5+RND(1)); : GOTO 10</pre><pre>RUN</pre><tt id="foo"></tt><script>setInterval(type,1);function type(){document.getElementById("foo").textContent+="/\"[+(Math.random()<0.5)];}</script><style>#foo,pre{padding:none;line-height:0.9;font-size:2em}#foo{letter-spacing:-0.1em}</style>
@dragoncoder047
dragoncoder047 / i2crepl.ino
Last active May 29, 2023 13:48
Quick I2C REPL for Arduinos.
#include <Wire.h>
#include <string.h>
void setup() {
Wire.begin();
Wire.setClock(1000);
Serial.begin(115200);
Serial.println("i2c REPL");
}
unsigned int tgt_addr = 0x05;
void loop() {
@dragoncoder047
dragoncoder047 / airdrop.py
Last active October 7, 2023 21:12
Airdrop for non-Apple users
#! /usr/bin/env python3
from flask import Flask, request, send_file, abort
from os import walk, sep, makedirs, getpid
from os.path import exists, basename
from werkzeug.utils import secure_filename
from subprocess import Popen
app = Flask(__name__)