Skip to content

Instantly share code, notes, and snippets.

@baskaufs
baskaufs / mermaid.md
Last active Mar 21, 2022
test of mermaid diagram
View mermaid.md
  graph TD;
    a[standard proposed]-->b[executive decision];
    b-->c[expert review];
    c-->d[executive decision];
@baskaufs
baskaufs / boot.py
Created Feb 21, 2022
boot script for switch-based control of QT Py RP2040 memory read/write
View boot.py
import board
import digitalio
import storage
switch = digitalio.DigitalInOut(board.D0)
switch.direction = digitalio.Direction.INPUT
switch.pull = digitalio.Pull.UP
# Connecting D0 to ground makes switch.value False
storage.remount("/", switch.value)
@baskaufs
baskaufs / code.py
Created Feb 21, 2022
Code to store LSM6DS33 accel and gyro data using QT Py RP2040
View code.py
import time
seconds_to_run = 120
measurements_per_second = 30.6 # determined emprically when running full speed, not imposed by sleep statement
#delay_time = 1/ measurements_per_second # time to delay between multiple measurements
# Set up "board" (QT Py RP2040)
import board
import busio # contains an interface for using hardware-driven I2C communication from your board
i2c = busio.I2C(board.SCL1, board.SDA1)
@baskaufs
baskaufs / ceiling_fan_lsm6ds33.csv
Created Feb 21, 2022
ceiling fan data, LSM6DS33 sensor, acc range: 4g, gyro range: 500 deg/s, 50 revolutions per 47 seconds
View ceiling_fan_lsm6ds33.csv
seconds x_acc y_acc z_acc x_gyro y_gyro z_gyro
0.241211 -0.404387 0.870988 -9.52343 -0.00454929 -0.100756 0.0606358
0.259766 -0.48335 0.872184 -9.68974 -0.00180042 -0.120303 0.057276
0.275391 -0.547956 0.875773 -9.6694 -0.00180042 -0.0176781 0.0536108
0.291016 -0.514457 0.882952 -9.64786 0.000337616 0.0406595 0.0471968
0.307617 -0.491725 0.875773 -9.48994 0.00186478 0.0348563 0.0456696
0.323242 -0.497707 0.835095 -9.63231 0.00064306 0.0641778 0.0429207
0.338867 -0.534796 0.856631 -9.6036 0.000948489 0.0589855 0.0392555
0.426758 -0.491725 0.856631 -9.56172 0.00766799 0.0266097 0.0218459
0.444336 -0.404387 0.850649 -9.55454 0.00675172 0.0104217 0.019097
@baskaufs
baskaufs / code.py
Last active Apr 1, 2022
CircuitPython code to use with VCNL 4040 proximity and lux sensor
View code.py
import time
import board
import busio
import adafruit_vcnl4040
i2c = busio.I2C(board.SCL1, board.SDA1)
sensor = adafruit_vcnl4040.VCNL4040(i2c)
while True:
print("Proximity:", sensor.proximity)
@baskaufs
baskaufs / code.py
Created Jan 26, 2022
CircuitPython code to flask LED on QT PY RP2040
View code.py
import time
import board
import neopixel
pixels = neopixel.NeoPixel(board.NEOPIXEL, 1)
while True:
pixels.fill((255, 0, 0))
time.sleep(0.1)
pixels.fill((0, 0, 0))
@baskaufs
baskaufs / gallery_works.csv
Created Jan 25, 2022
Q IDs, labels, and descriptions of Vanderbilt Fine Arts Gallery works in Wikidata
View gallery_works.csv
@baskaufs
baskaufs / five_letter_6of12.txt
Created Jan 17, 2022
2529 five-letter words from "6 of 12" list of American English words http://wordlist.aspell.net/12dicts-readme/#nof12
View five_letter_6of12.txt
aback
abaft
abase
abash
abate
abbey
abbot
abeam
abhor
abide
View five_letter.txt
abaca
aback
abaft
abase
abash
abate
abbey
abbot
abdal
abeam
View five_letter.txt
aahed
aalii
aargh
abaca
abaci
aback
abaft
abaka
abamp
abase