Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/TurtleArt/talogo.py
diff options
context:
space:
mode:
Diffstat (limited to 'TurtleArt/talogo.py')
-rw-r--r--TurtleArt/talogo.py25
1 files changed, 11 insertions, 14 deletions
diff --git a/TurtleArt/talogo.py b/TurtleArt/talogo.py
index 8327d1a..2e172f4 100644
--- a/TurtleArt/talogo.py
+++ b/TurtleArt/talogo.py
@@ -1088,20 +1088,17 @@ class LogoCode:
""" If there are sensor blocks, set the appropriate audio mode """
for name in ['sound', 'volume', 'pitch']:
if len(self.value_blocks[name]) > 0:
- if self.audio_mode != 'sound':
- self.tw.audiograb.set_sensor_type()
- self.audio_mode = 'sound'
- return
- elif len(self.value_blocks['resistance']) > 0:
- if self.audio_mode != 'resistance':
- self.tw.audiograb.set_sensor_type(SENSOR_DC_BIAS)
- self.audio_mode = 'resistance'
- return
- elif len(self.value_blocks['voltage']) > 0:
- if self.audio_mode != 'voltage':
- self.tw.audiograb.set_sensor_type(SENSOR_DC_NO_BIAS)
- self.audio_mode = 'voltage'
- return
+ self.tw.audiograb.set_sensor_type()
+ self.audio_mode = 'sound'
+ return
+ if len(self.value_blocks['resistance']) > 0:
+ self.tw.audiograb.set_sensor_type(SENSOR_DC_BIAS)
+ self.audio_mode = 'resistance'
+ return
+ elif len(self.value_blocks['voltage']) > 0:
+ self.tw.audiograb.set_sensor_type(SENSOR_DC_NO_BIAS)
+ self.audio_mode = 'voltage'
+ return
def update_label_value(self, name, value=None):
""" Update the label of value blocks to reflect current value """