Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
pub
hello-world
xmega
Commits
537f79b2
Commit
537f79b2
authored
Aug 08, 2017
by
Sam Calisch
Browse files
clean up
parent
9c392147
Pipeline
#618
passed with stage
in 1 second
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
i2c/load.py
View file @
537f79b2
...
...
@@ -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
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment