Skip to content

Instantly share code, notes, and snippets.

View mattvenn's full-sized avatar

matt venn mattvenn

View GitHub Profile
@mattvenn
mattvenn / install.md
Created May 19, 2018 10:37
install kicad from source on ubuntu 18.04 LTS

kdir kicad-build cd kicad-build git clone -b master https://git.launchpad.net/kicad cd kicad/ git checkout 3045509 mkdir -p build/release cd build/release/

sudo apt install cmake sudo apt install build-essential

@mattvenn
mattvenn / i2c-plot.py
Created February 5, 2018 20:13
plot i2c read variance
import serial
import re
"""
i2c data captured with sigrok-cli:
sigrok-cli -C 0,1 -c "samplerate=500k:voltage_threshold=1.8-1.8:continuous=on" --driver=dreamsourcelab-dslogic --samples 10M -P i2c:sda=1:scl=0 -A i2c=address-write --protocol-decoder-samplenum > data.raw
"""
samplerate = 1.0/500e3
@mattvenn
mattvenn / gist:930590aabbb46beba6a9306312d3e620
Last active June 7, 2017 10:13
GDB + debugWire + Linux

gdb + avarice + debugwire on attiny88

enable debugwire

enable with avrdude (fuse for attiny88):

avrdude -c dragon_isp -P usb -p attiny88 -v -U hfuse:w:0xd9:m

compilation

samp = [1 ,1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1]
state = 1
db0 = 0
db1 = 0
print("samp = button state 0 is pressed")
print("delta = samp ^ state difference between sample and state")
print("db0 = ~(db0) & delta first bit of 2 bit counter")
print("db1 = (db1 ^ db0) & delta second bit of 2 bit counter")
print("changes = ~(~delta | db0 | db1) if a change has happened")
print("state = state ^ changes state of the debouncer")
@mattvenn
mattvenn / blackice.md
Last active February 21, 2018 22:23
upload firmware to mystorm blackice board
@mattvenn
mattvenn / turtleprize.com competition entry
Created February 12, 2016 13:26
Author: L.GAINEY, School: oldfieldschool
from turtle import*
turn = 0
speed (1000)
while turn <72:
pencolor ("Pink")
pensize(10)
forward(100)
back(100)
right(270)
@mattvenn
mattvenn / turtleprize.com competition entry
Created February 12, 2016 13:25
Author: L.GAINEY, School: oldfieldschool
from turtle import *
color('purple', 'black')
begin_fill()
while True:
forward(200)
left(170)
if abs(pos()) < 1:
break
end_fill()
penup ()
@mattvenn
mattvenn / turtleprize.com competition entry
Created February 12, 2016 13:20
Author: L.GAINEY, School: oldfieldschool
from turtle import *
import turtle
speed(0)
ninja = turtle.Turtle()
ninja.speed(0)
for i in range(180):
ninja.forward(100)
@mattvenn
mattvenn / turtleprize.com competition entry
Created February 12, 2016 13:20
Author: L.GAINEY, School: oldfieldschool
from turtle import *
import turtle
speed(0)
ninja = turtle.Turtle()
ninja.speed(0)
for i in range(180):
ninja.forward(100)
@mattvenn
mattvenn / turtleprize.com competition entry
Created February 12, 2016 13:19
Author: L.GAINEY, School: oldfieldschool
from turtle import *
import turtle
speed(0)
ninja = turtle.Turtle()
ninja.speed(0)
for i in range(180):
ninja.forward(100)