Skip to content

Instantly share code, notes, and snippets.

@standarddeviant
standarddeviant / build.nu
Created June 9, 2024 12:08
Rust BLE recipe on nRF52840
let startdir = pwd
if not ('nrf-softdevice' | path exists) {
git clone https://github.com/embassy-rs/nrf-softdevice.git
}
cd ([nrf-softdevice examples] | path join)
if not ('uf2conv.py' | path exists) {
http get https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2families.json | save uf2families.json
http get https://raw.githubusercontent.com/microsoft/uf2/master/utils/uf2conv.py | save uf2conv.py
# search for 'pub fn' and capture paths, and lines
# NOTE: could get line number
let tmp = rg --json 'pub fn' | rg '"type":"match"' | from json -o
echo ($tmp | each {|m| $m.data}) # debug
let df = $tmp | each {
|m| {
@standarddeviant
standarddeviant / eben2.ipynb
Last active October 6, 2022 11:56
Fun with audio manipulation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@standarddeviant
standarddeviant / bits.ipynb
Created September 6, 2022 02:55
bits.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
"""
Embedded Python Blocks:
Each time this file is saved, GRC will instantiate the first class it finds
to get ports and parameters of your block. The arguments to __init__ will
be the parameters. All of them are required to have default values!
"""
import numpy as np
from gnuradio import gr
@standarddeviant
standarddeviant / README.md
Last active March 24, 2022 04:53
Micropython IMU recording to internal flash
graph TD
    imu(Accel + Gyro<br>over I2C) --> imufetch
    imufetch[[imu_fetch_task]] --> datalist
    datalist[(Data List<br>with lock)]
    datalist --> filewrite[[file_write_task]]
    filewrite --> localfile[(local file)]

    mainstart{main_task<br>loop start}
 --&gt; |wait onrecord_start_event| mainspawn(SPAWN tasks1. imu_fetch_task2. file_write_task)
@standarddeviant
standarddeviant / make_mpy.sh
Created March 16, 2022 14:37
Make a wifi connect utility for micropython
python -m mpy_cross wifi_connect.py
@standarddeviant
standarddeviant / tsp32.html
Last active March 1, 2022 13:54
TSP32 UI
<!doctype html>
<html>
<head>
<style>
.note_button {
background-color: #1f78b4;
border: none;
color: white;
padding: 15px 32px;
text-align: center;
@standarddeviant
standarddeviant / viridis_approx.ipynb
Created January 20, 2022 15:13
Viridis Approximation for RGB565
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.