Skip to content

Instantly share code, notes, and snippets.

View pingswept's full-sized avatar

Brandon Stafford pingswept

  • Tufts University
  • Somerville, Massachusetts, USA
View GitHub Profile
https://us-school.pk12ls.com/school/fe1b3ad5-8762-4e0f-8e3d-56440bfbe441/D0680545/player.html
@pingswept
pingswept / drivestrength.ino
Created October 26, 2020 21:27
Fixing the drive strength mode on the Arduino MKR Wifi 1010
void setup() {
pinMode(4, OUTPUT);
setHighStrengthOutputPinMode(4);
}
void loop() {
digitalWrite(4, HIGH);
}
bool setHighStrengthOutputPinMode( uint32_t ulPin)
@pingswept
pingswept / ventilate.py
Last active July 1, 2018 00:08
Python script to turn a fan on and off based on SHT31 temperature and temperature from the internet
from Adafruit_IO import *
import json
import requests
import RPi.GPIO as GPIO
import smbus
import time
aio = Client('XXXXXXXXXXXXXXXXX_ADAFRUIT_API_KEY_GOES_HERE_XXXXXXXXXXXXXXXXX')
GPIO.setmode(GPIO.BCM) # choose BCM or BOARD
@pingswept
pingswept / replify.py
Created August 8, 2017 14:54
Script for Chris to manipulate his G-code
infile = "infile.txt" # the file to open
copies = 3 # how many copies to make
marker = "STARTHERE\n"
with open(infile, 'r') as infile:
lines = infile.readlines()
#print(lines)
startline = lines.index(marker)
result = ''.join(lines + (lines[startline + 1:] * copies))
Brand Model Size Width Good/bad
New Balance Fresh Foam Gobi 14 EE Ill-fitting and stiff, but low arch is good. VL-6 last. Might be okay. Should try v2, will drop in July 2017.
New Balance Fresh Foam Hierro v2 14 4E Almost good but arch too high. Same PL-4 last as favorite MO69v1's. Disappointing.
New Balance Minimus 10v1 14 EE Almost good but arch too high. NL-1 last. Very comfy other than arch.
Montrail Fluid Flex FKT 14 -- WINNER! 8 pairs, 6 left. Update: not on Zappos any more. One color on columbia.com, May 2017.
Brooks Puregrit 4 14 -- Trevor recommended but haven't tried yet because of previous Brooks being too short in 14.
Topo MT-2 14 -- Kept. Might be serviceable.
Montrail Fluid Flex ST 14 -- WINNER! 3 pairs. Update: no longer available.
Nike Air Zoom Wildhorse 3 14 -- kept. Insole is a little stiff but could be a winner.
Montrail Fluid Flex II 14 ? Good. 1 pair. Blisters on long runs. Update: no longer available.
@pingswept
pingswept / winterize.md
Last active September 3, 2015 15:06
Winterizing the house

Closing

  • Cut power to well pump
  • Cut power to hot water heater with circuit breaker
  • Close main water valve
  • Open all faucets, and leave them open
    • kitchen sink, including blowing out spray hose
    • bathroom #1, including shower
    • bathroom #2, including shower
  • Drain water heater through garden hose
@pingswept
pingswept / precision-voltage-shield-on-arduino-due.ino
Last active September 1, 2015 20:06
Code for the Rascal Micro Precision Voltage Shield on an Arduino Due
/* Works, but very slow. */
/* Licensed under the GNU General Public License, version 3 */
/* Copyright Brandon Stafford, September 1, 2015 */
#define SCALE_FACTOR 0.000152587890625
// 10/(2^16) = 0.000152587890625
#define BUSY 3
#define RESET 4
@pingswept
pingswept / replace.md
Last active September 3, 2015 13:52
things
  • cutting boards (have 3, all stained and worn out)
  • knives (have 1 good, small, serrated knife (orange handle))
  • sand floor near front door
  • refrigerator: loud, handle loose, shelves cracked
  • creepy lights in downstairs bathroom
  • lights under counter edge in kitchen
  • powerwash deck, or at least somehow make less slippery (especially stairs outside dining room)
@pingswept
pingswept / travel-checklist.markdown
Last active August 29, 2015 14:24
Travel checklist

Clothes

  • t-shirts
  • cotton shorts
  • synthetic shorts
  • pants
  • belt
  • sleeping shirts
  • boxers
  • synthetic socks not for running
@pingswept
pingswept / minimal.py
Last active August 29, 2015 14:18 — forked from clouetb/minimal.py
#!/usr/bin/python
from pruio import *
from time import sleep
# Create a ctypes *pointer* to the pruio structure
io = pruio_new(PRUIO_DEF_ACTIVE, 0, 0, 0)
# Note the *pointer* dereferencing using the contents member
if not io.contents.Errr:
pruio_config(io, 1, 0, 0, 0)
for i in range(4):