This commit is contained in:
Michael Fogleman 2018-01-22 16:23:10 -05:00
parent 2d622ee671
commit 1f18e89c8d
2 changed files with 14 additions and 11 deletions

View File

@ -25,9 +25,9 @@ PEN_DOWN_POSITION = 45
PEN_DOWN_SPEED = 150 PEN_DOWN_SPEED = 150
PEN_DOWN_DELAY = 0 PEN_DOWN_DELAY = 0
ACCELERATION = 6 ACCELERATION = 4
MAX_VELOCITY = 6 MAX_VELOCITY = 6
CORNER_FACTOR = 0.005 * 2 CORNER_FACTOR = 0.005 * 3
VID_PID = '04D8:FD92' VID_PID = '04D8:FD92'

View File

@ -5,12 +5,14 @@ import numpy as np
import os import os
import sys import sys
NUMBER = 1 NUMBER = 4
TITLE = 'Five Seconds of Donkey Kong' TITLE = 'Five Seconds of Balloon Fight'
LABEL = '#%d' % NUMBER LABEL = '#%s' % NUMBER
COLUMNS = 6 COLUMNS = 8
SECONDS = 5 SECONDS = 5
FRAME_OFFSET = 120
MIN_CHANGES = 1
def stack_drawings(ds, spacing=0): def stack_drawings(ds, spacing=0):
result = axi.Drawing() result = axi.Drawing()
@ -55,13 +57,14 @@ def main():
# trim to SECONDS worth of data # trim to SECONDS worth of data
n = len(data[0]) n = len(data[0])
m = SECONDS * 60 / 2 m = int(SECONDS * 60 / 2)
a = max(0, int(n // 2 - m)) mid = int(n // 2) + FRAME_OFFSET
b = min(n, int(n // 2 + m)) a = max(0, mid - m)
b = min(n, mid + m)
data = [x[a:b] for x in data] data = [x[a:b] for x in data]
# remove addresses with too few values # remove addresses with too few values
data = [x for x in data if len(set(x)) > 1] data = [x for x in data if len(set(x)) > MIN_CHANGES]
print '%d series that changed' % len(data) print '%d series that changed' % len(data)
@ -101,7 +104,7 @@ def main():
print d.bounds print d.bounds
# save outputs # save outputs
dirname = 'nes/%d' % NUMBER dirname = 'nes/%s' % NUMBER
try: try:
os.makedirs(dirname) os.makedirs(dirname)
except Exception: except Exception: