summaryrefslogtreecommitdiff
path: root/robot/problems/introduction/followline/common.py
diff options
context:
space:
mode:
Diffstat (limited to 'robot/problems/introduction/followline/common.py')
-rw-r--r--robot/problems/introduction/followline/common.py12
1 files changed, 5 insertions, 7 deletions
diff --git a/robot/problems/introduction/followline/common.py b/robot/problems/introduction/followline/common.py
index 3e84cd4..e28ca35 100644
--- a/robot/problems/introduction/followline/common.py
+++ b/robot/problems/introduction/followline/common.py
@@ -11,8 +11,6 @@ visible = True
solution = '''\
import time
-from ev3dev import *
-from mindstorms_widgets import mindstorms_widgets
robot = mindstorms_widgets()
robot.connect_motor( 'left' )
@@ -21,10 +19,10 @@ robot.connect_sensor( 'color' )
start = time.time()
while time.time()-start < 10:
- if robot.color_sensor_measure('reflected_light_intensity') < 30:
- L, R = 0, 20
+ if robot.color_sensor_measure('reflected_light_intensity') < 50:
+ L, R = 0, 30
else:
- L, R = 20, 0
+ L, R = 30, 0
robot.move_tank( 'on', lr_power=[L,R])
robot.move_tank( 'off' )
'''
@@ -61,13 +59,13 @@ def hint( code):
if not (has_token_sequence(tokens, ['connect_sensor', '(' ]) and 'color' in code):
return [{'id': 'connectColorSensor'}]
- if not (has_token_sequence(tokens, ['move_steering', '(']) and 'on' in code):
+ if not (has_token_sequence(tokens, ['move_tank', '(']) and 'on' in code):
return [{'id': 'moveTankOn'}]
if not 'lr_power' in code:
return [{'id': 'lrPower'}]
- if not (has_token_sequence(tokens, ['move_steering', '(']) and 'off' in code):
+ if not (has_token_sequence(tokens, ['move_tank', '(']) and 'off' in code):
return [{'id': 'moveTankOff'}]
if not (has_token_sequence(tokens, ['color_sensor_measure', '(']) and 'reflected_light_intensity' in code):