From be94b55b835283de53c686343164641e15abe806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=BDabkar?= Date: Mon, 14 Dec 2015 12:44:58 +0100 Subject: Zadnje spremembe pred zagovorom. --- robot/problems/introduction/wall1m/common.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'robot/problems/introduction/wall1m') diff --git a/robot/problems/introduction/wall1m/common.py b/robot/problems/introduction/wall1m/common.py index 07d1e1a..4492cdc 100644 --- a/robot/problems/introduction/wall1m/common.py +++ b/robot/problems/introduction/wall1m/common.py @@ -10,8 +10,7 @@ number = 6 visible = True solution = '''\ -from ev3dev import * -from mindstorms_widgets import mindstorms_widgets +from mindstorms_widgets import * robot = mindstorms_widgets() robot.connect_motor( 'left' ) -- cgit v1.2.1 From b4e46b75f5e2a890b41d2e20a89767590e54ccb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=BDabkar?= Date: Tue, 15 Dec 2015 10:34:40 +0100 Subject: Dodani plani za robotske probleme. --- robot/problems/introduction/wall1m/common.py | 2 -- robot/problems/introduction/wall1m/sl.py | 14 ++++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'robot/problems/introduction/wall1m') diff --git a/robot/problems/introduction/wall1m/common.py b/robot/problems/introduction/wall1m/common.py index 4492cdc..42b4067 100644 --- a/robot/problems/introduction/wall1m/common.py +++ b/robot/problems/introduction/wall1m/common.py @@ -10,8 +10,6 @@ number = 6 visible = True solution = '''\ -from mindstorms_widgets import * - robot = mindstorms_widgets() robot.connect_motor( 'left' ) robot.connect_motor( 'right' ) diff --git a/robot/problems/introduction/wall1m/sl.py b/robot/problems/introduction/wall1m/sl.py index 18518d5..cbb27ed 100644 --- a/robot/problems/introduction/wall1m/sl.py +++ b/robot/problems/introduction/wall1m/sl.py @@ -29,3 +29,17 @@ hint = { 'while':['''

Uporabi zanko: robot naj se pelje naprej, dokler ne pride do razdalje 50 cm od zida.

''', '''

Uporabi še eno zanko: robot naj se pelje naprej z 20% močjo, dokler ne pride do razdalje 20 cm od zida.

'''], } + +plan = ['''\ +

Program izvedemo v naslednjih korakih:

+
    +
  1. Naredimo objekt mindstorms_widgets(), s katerim predstavimo robota.
  2. +
  3. Nanj povežemo oba pogonska motorja.
  4. +
  5. Robotu dodamo ultrazvočni senzor.
  6. +
  7. Vklopimo oba motorja tako, da robot vozi naravnost; moč nastavimo na 80.
  8. +
  9. V zanki merimo razdaljo z UZ senzorjem; zanko končamo, ko je razdalja <50 cm.
  10. +
  11. Moč motorjev nastavimo na 20.
  12. +
  13. V zanki merimo razdaljo z UZ senzorjem; zanko končamo, ko je razdalja <20 cm.
  14. +
  15. Ustavimo oba motorja.
  16. +
''' +] -- cgit v1.2.1 From 0883cb2a6b0bac23bd7553618f4e8db7c882a757 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=BDabkar?= Date: Tue, 15 Dec 2015 13:13:49 +0100 Subject: Popravki programov pred zagovorom projekta. --- robot/problems/introduction/wall1m/common.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'robot/problems/introduction/wall1m') diff --git a/robot/problems/introduction/wall1m/common.py b/robot/problems/introduction/wall1m/common.py index 42b4067..e8a5917 100644 --- a/robot/problems/introduction/wall1m/common.py +++ b/robot/problems/introduction/wall1m/common.py @@ -15,10 +15,10 @@ robot.connect_motor( 'left' ) robot.connect_motor( 'right' ) robot.connect_sensor( 'ultrasonic' ) robot.move_steering( 'on', power=80 ) -while robot.ultrasonic_sensor_measure( 'distance-cm' ) > 500: +while robot.ultrasonic_sensor_measure( 'distance-cm' ) > 50: pass robot.move_steering( 'on', power=20 ) -while robot.ultrasonic_sensor_measure( 'distance-cm' ) > 200: +while robot.ultrasonic_sensor_measure( 'distance-cm' ) > 20: pass robot.move_steering( 'off' ) ''' -- cgit v1.2.1