View dump_regs.py
"""
usage:
import dump_regs
dump_regs.dump_regs()
"""
import re
import stm
# basically this, with some deletions (FLASH, DBGMCU):
# {m for m in dir(stm) if '_' not in m}
View hv_pulser_attempted_reproduction.py
import pyb
from pyb import Timer
import micropython
import stm
#john's sript actual pulse width 181 us, 448 us period (pulse to pulse)
# Use with pyb.freq(96000000) and prescaler=11 for .25 usec timer ticks.
xfmr_pulse_period = 1570 # (= usec * 4) Same as toggle_half_cycle duration.
xfmr_pulse_w = 332 # (= usec * 4)
View cryptominisat_router.py
from collections import OrderedDict
import os
import subprocess
import sys
import multiprocessing
import itertools
def split_seq(iterable, size):
it = iter(iterable)
View monosat_router.py
from collections import OrderedDict, defaultdict
import os
import sys
import subprocess
from copy import deepcopy
from monosat import *
# enable using multiple levels of dict keys automatically, even if nested levels don't yet exist
NestedDict = lambda: defaultdict(NestedDict)
View buildozer.spec
[app]
# (str) Title of your application
title = My Application
# (str) Package name
package.name = myapp
# (str) Package domain (needed for android/ios packaging)
package.domain = org.test
View main.py
import pyb
from pyb import Timer
# timer 2 will be created with a frequency of 10 kHz
tim=pyb.Timer(4,freq=10000);
# attach the timer to the LED GPIO, turning the brightness OFF to begin
tchannel = tim.channel(3, Timer.PWM, pin=pyb.Pin.board.JP32, pulse_width_percent=0)
# setup comm channel, for debug prints
# uart = pyb.UART(2, 9600) # init with given baudrate
View pycosat.c
/*
Copyright (c) 2013, Ilan Schnell, Continuum Analytics, Inc.
Python bindings to picosat (http://fmv.jku.at/picosat/)
This file is published under the same license as picosat itself, which
uses an MIT style license.
*/
#define PYCOSAT_URL "https://pypi.python.org/pypi/pycosat"
#include <Python.h>
#include "structmember.h"
View duplicate STL for printing multiple copies
import math
import stl
from stl import mesh
import numpy
# find the max dimensions, so we can know the bounding box, getting the height, width, length (because these are the step size)...
def find_mins_maxs(obj):
minx = maxx = miny = maxy = minz = maxz = None
for p in obj.points:
View diffractive lens nanopillar outlines via openCV
import numpy as np
import cv2
import math
h=1000
w=1000
scaling = 20.
fin_w = 85
View rename_kicad_gerbers.py
"""
Renames KiCad plot and drill files to the correct OSHpark file extensions, and also puts all these into a ZIP file.
usage:
python rename_kicad_gerbers.py path/to/my/project/plot_output
returns:
kicad_out.zip (in the directory you ran the script from)
"""
import os