Commit 537f79b2 authored by Sam Calisch's avatar Sam Calisch

clean up

parent 9c392147
Pipeline #618 passed with stage
in 1 second
......@@ -10,11 +10,6 @@
# (c) Massachusetts Institute of Technology 2009
# Permission granted for experimental and personal use;
# license for commercial sale available from MIT
#
#serial port seems like ttyUSB0
# or usb-FTDI_FT232R_USB_UART_A501JTMW-if00-port0
#or ../../ttyUSB0
from Tkinter import *
import serial,time
......@@ -47,15 +42,12 @@ def idle(parent,canvas):
break
low = ord(ser.read())
high = ord(ser.read())
#newvalue=ord(ser.read())
value = 256*high + low
print value
f.write("%f,%d\n"%(time.time()-t0,value) )
#print value#low,high
filter = (1-eps)*filter + eps*value
x = int(.2*WINDOW + (.9-.2)*WINDOW*filter/1024.0)
#canvas.itemconfigure("text",text="%.1f"%newvalue)
canvas.coords('rect1',.2*WINDOW,.05*WINDOW,x,.2*WINDOW)
canvas.coords('rect2',x,.05*WINDOW,.9*WINDOW,.2*WINDOW)
canvas.update()
......@@ -68,16 +60,9 @@ if (len(sys.argv) != 2):
print "command line: hello.light.44.py serial_port"
sys.exit()
port = sys.argv[1]
#
# open serial port
#
### CHANGE THIS FOR DIFFERENT BAUD FOR 44 INSTEAD OF 45?????
#or more relevantly, the clock issues? internal instead of external; 1 or 8?
#maybe messes up bit delays...
ser = serial.Serial(port,230400)
ser.flush()
#ser = serial.Serial(port,115200)
ser.setDTR()
#
# set up GUI
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment