Skip to content

Commit df1caf7

Browse files
author
Dilawar Singh
committed
annonations are in division; not in ms and V. Now annotations are
scaling invariant.
1 parent 308e4b5 commit df1caf7

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

SerialScope/arduino.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def idealDelayForInteral():
3232
while len(data) < 5e3:
3333
t = time.time() - t0
3434
data.append(interalFun(t))
35-
return max(0, (1-t)/5e3)
35+
return max(0, (1-t)/10e3)
3636

3737
class SerialReader():
3838
"""docstring for SerialReader"""
@@ -46,7 +46,6 @@ def __init__(self, port, baud, debug = False):
4646
self.devname = ''
4747
self.lock = threading.Lock()
4848
self.internalDelay = idealDelayForInteral()
49-
print( self.internalDelay )
5049
try:
5150
self.s = serial.Serial(port, baud)
5251
except Exception as e:

SerialScope/gui.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -251,11 +251,11 @@ def createAnnotation(self, evName, evValue):
251251
hL = self.graph.DrawLine((self.bottomLeft[0], y),
252252
(self.topRight[0], y),
253253
color=self.annotationColor)
254-
T, V = x, y * 5 / 255.0
255-
annText = f"{T*1000:.1f} ms/{V:.2f}"
254+
T, V = x / self.gridSize[0], y / self.gridSize[1]
255+
annText = f"{T:.1f},{V:.1f}"
256256
t = self.graph.DrawText(annText, (x, y + 8),
257257
color='white',
258-
font='Helvetica 8')
258+
font='Helvetica 10')
259259
self.annotation.append((t, vL, hL))
260260

261261
def handleMouseEvent(self, event, value):

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
setup(
1010
name = "SerialScope",
11-
version = "0.1.2",
11+
version = "0.1.3",
1212
description = "A serial-port based oscilloscope",
1313
long_description = readme,
1414
long_description_content_type='text/markdown',

0 commit comments

Comments
 (0)