diff options
author | Walter Bender <walter@sugarlabs.org> | 2010-11-04 12:12:13 (GMT) |
---|---|---|
committer | Walter Bender <walter@sugarlabs.org> | 2010-11-04 12:12:13 (GMT) |
commit | 4c8dda5afdc6c9eab79c960b2ffd7b53313e5cbc (patch) | |
tree | 51e601a46dc891f9064ddaabb111a62e5d9100d7 /TurtleArt | |
parent | 6e66406b41397d81840407d06bd7667e917eb232 (diff) |
preliminary calibration of voltage sensor (thanks to Tony Forster) and removal of unneded debugging output in pitch section
Diffstat (limited to 'TurtleArt')
-rw-r--r-- | TurtleArt/talogo.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py index 0bcb467..6f9e453 100644 --- a/TurtleArt/talogo.py +++ b/TurtleArt/talogo.py @@ -1401,11 +1401,11 @@ class LogoCode: buf = [] for i in range(4): buf = append(buf, self.ringbuffer.read(None, self.input_step)) - print len(buf) if len(buf) > 0: r = [] for j in rfft(buf): r.append(abs(j)) + # Convert output to Hertz return r.index(max(r)) * 48000 / len(buf) else: return 0 @@ -1422,7 +1422,8 @@ class LogoCode: """ return voltage sensor value """ buf = self.ringbuffer.read(None, self.input_step) if len(buf) > 0: - return float(_avg(buf)) + # TODO: test this calibration on XO 1.5 + return float(_avg(buf)) * 0.0000219 + 1.14 else: return 0 |