Skip to content

Instantly share code, notes, and snippets.

@wildestpixel
wildestpixel / code.py
Last active July 17, 2022 23:43
Raspberry Pi Pico & Pimoroni RGB Keypad HID in Circuitpython 6.2+
# Adapted from Sandy J Macdonald's gist at https://gist.github.com/sandyjmacdonald/b465377dc11a8c83a8c40d1c9b990a90 to configure all buttons and switch off all lights in loop
import time
import board
import busio
import usb_hid
from adafruit_bus_device.i2c_device import I2CDevice
import adafruit_dotstar
@sandyjmacdonald
sandyjmacdonald / code.py
Created January 21, 2021 22:27
RGB MIDI controller example for Pimoroni RGB Keypad for Raspberry Pi Pico
import time
import board
import busio
import usb_midi
import adafruit_midi
from adafruit_midi.note_off import NoteOff
from adafruit_midi.note_on import NoteOn
from adafruit_bus_device.i2c_device import I2CDevice
import adafruit_dotstar
@k0d
k0d / openocd.txt
Last active December 29, 2020 05:50
samd21 with openecd
```brew install openocd```
make a file called openocd.cfg in a folder containing...
# Atmel-ICE JTAG/SWD in-circuit debugger.
interface cmsis-dap
# Chip info
set CHIPNAME at91samd21g18
source [find target/at91samdXX.cfg]
@JoanTheSpark
JoanTheSpark / KiCAD_CopperSpiral_v2.py
Created November 27, 2015 08:54
v2 with spin direction and increasing amount of segments per turn for smoother result in outer circles
import sys, os
import shutil
import math
import itertools
from copy import deepcopy
# 0 1 2 3 4 5 6
LIST_elmt = [" ("," (start ",") (end ",") "," (layer ",") ","))"]
#LIST_elmt = [" (gr_line (start 131.571908 182.314571) (end 112.874456 120.68499) (angle 90) (layer Dwgs.User) (width 0.1))"]
#LIST_elmt = [" (segment (start 118.7 106.7) (end 119.4 106.7) (width 0.25) (layer B.Cu) (net 0))"]
@donaldh
donaldh / README.md
Created June 12, 2012 22:36
force-multi-foci with convex hulls

I have modified the force-multi-foci example to add a convex hull around each cluster of nodes.

I achieved this by using d3.nest() to create a new dataset of clusters containing the nodes in each cluster. Then in the tick() method I create and update the path element for each cluster in this dataset.