Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plugins/audio_sensors/audio_sensors.py
diff options
context:
space:
mode:
authorPootle daemon <pootle@pootle.sugarlabs.org>2012-06-04 04:32:22 (GMT)
committer Pootle daemon <pootle@pootle.sugarlabs.org>2012-06-04 04:32:22 (GMT)
commitc2e2b9523a002fd9eb997afd46656f3e1cd0487b (patch)
treeb51186f32e677ad58444a40b583709ec1202009e /plugins/audio_sensors/audio_sensors.py
parent72d128955161302693abced7e768cf13bc6bc304 (diff)
parent116938af82df38e0a06909e30ca64db4fce23f82 (diff)
Merge branch 'master' of git.sugarlabs.org:turtleart/mainline
Diffstat (limited to 'plugins/audio_sensors/audio_sensors.py')
-rw-r--r--plugins/audio_sensors/audio_sensors.py12
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/audio_sensors/audio_sensors.py b/plugins/audio_sensors/audio_sensors.py
index 978a17d..0662acb 100644
--- a/plugins/audio_sensors/audio_sensors.py
+++ b/plugins/audio_sensors/audio_sensors.py
@@ -354,13 +354,21 @@ class Audio_sensors(Plugin):
else:
resistance = 420000000
elif self.hw == XO175:
- return (180000000 / (30700 - avg_buf)) - 3150
+ if avg_buf < 30700:
+ return (180000000 / (30700 - avg_buf)) - 3150
+ else:
+ resistance = 999999999
else: # XO 3.0
- return (46000000 / (30514 - avg_buf)) - 1150
+ if avg_buf < 30514:
+ return (46000000 / (30514 - avg_buf)) - 1150
+ else:
+ resistance = 999999999
if channel == 0:
self._parent.lc.update_label_value('resistance', resistance)
else:
self._parent.lc.update_label_value('resistance2', resistance)
+ if resistance < 0:
+ resistance = 0
return resistance
else:
return 0