diff options
Diffstat (limited to 'robot/problems/introduction/followline')
-rw-r--r-- | robot/problems/introduction/followline/common.py | 8 | ||||
-rw-r--r-- | robot/problems/introduction/followline/sl.py | 15 |
2 files changed, 18 insertions, 5 deletions
diff --git a/robot/problems/introduction/followline/common.py b/robot/problems/introduction/followline/common.py index 3e84cd4..46df5c6 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' ) ''' diff --git a/robot/problems/introduction/followline/sl.py b/robot/problems/introduction/followline/sl.py index 848fe2b..cdc6e19 100644 --- a/robot/problems/introduction/followline/sl.py +++ b/robot/problems/introduction/followline/sl.py @@ -32,3 +32,18 @@ hint = { 'if': ['''<p>V zanki uporabi pogojni stavek...</p>''', '''<p>Če robot vidi črto, naj zavije z nje; če vidi podlago, naj zavije proti črti.</p>'''] } + +plan = ['''\ +<p>Program izvedemo v naslednjih korakih:</p> +<ol> + <li>Naredimo objekt mindstorms_widgets(), s katerim predstavimo robota.</li> + <li>Nanj povežemo oba pogonska motorja.</li> + <li>Povežemo barvni senzor.</li> + <li>V zanki preverjamo, kakšno barvo vidi robot s senzorjem.</li> + <li>Če vidi črno, naj zavije desno, če vidi belo, naj zavije levo. (Sledi desnemu robu črte).</li> + <li>Zanka naj se konča po vnaprej določenem času, 10 sekund.</li> + <li>Ustavimo oba motorja.</li> +</ol> +<p>Opomba: potrebna je predhodna kalibracija barvnega senzorja.</p> +''' +] |