MCPcopy Create free account
hub / github.com/ActiveState/code / getHR

Function getHR

recipes/Python/578800_FreshFish/recipe-578800.py:40–51  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38
39@FreshFish(2)
40def getHR():
41 if BBB and ser:
42 ser.write('G1' + chr(13))
43 res = readline()
44 if len(res) > 5:
45 out = int(res.split()[2])
46 else:
47 out = 0
48 else:
49 ### return a dummy result
50 out = int(50 * math.sin(time.time() / 20) + 50)
51 return out
52
53# ... in GUI
54

Callers 1

recipe-578800.pyFile · 0.85

Calls 4

sinMethod · 0.80
writeMethod · 0.45
splitMethod · 0.45
timeMethod · 0.45

Tested by

no test coverage detected