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/printcolors/naloga09_printColors.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'robot/problems/introduction/printcolors') diff --git a/robot/problems/introduction/printcolors/naloga09_printColors.py b/robot/problems/introduction/printcolors/naloga09_printColors.py index 59dfdb0..2e9d323 100644 --- a/robot/problems/introduction/printcolors/naloga09_printColors.py +++ b/robot/problems/introduction/printcolors/naloga09_printColors.py @@ -17,8 +17,7 @@ Naloga 9: import sys sys.path.append('/home/user/codeq') import time -from ev3dev import * -from mindstorms_widgets import mindstorms_widgets +from mindstorms_widgets import * color_table = ['none', 'black', 'blue', 'green', 'yellow', 'red', 'white', 'brown'] -- 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/printcolors/common.py | 2 -- robot/problems/introduction/printcolors/sl.py | 13 +++++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) (limited to 'robot/problems/introduction/printcolors') diff --git a/robot/problems/introduction/printcolors/common.py b/robot/problems/introduction/printcolors/common.py index 4377c57..9b06575 100644 --- a/robot/problems/introduction/printcolors/common.py +++ b/robot/problems/introduction/printcolors/common.py @@ -11,8 +11,6 @@ visible = True solution = '''\ import time -from ev3dev import * -from mindstorms_widgets import mindstorms_widgets color_table = ['none', 'black', 'blue', 'green', 'yellow', 'red', 'white', 'brown'] diff --git a/robot/problems/introduction/printcolors/sl.py b/robot/problems/introduction/printcolors/sl.py index d233b0e..c705eaa 100644 --- a/robot/problems/introduction/printcolors/sl.py +++ b/robot/problems/introduction/printcolors/sl.py @@ -34,3 +34,16 @@ hint = { '''

while time.time()-start < 1.1:.

'''], 'print':['''

V zanki na zaslon izpisuj barvo, ki jo zazna robot.

'''] } + +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. Povežemo barvni senzor.
  6. +
  7. Vklopimo oba motorja tako, da robot vozi naravnost.
  8. +
  9. V zanki naj robot bere barve in vsako izpiše na zaslon.
  10. +
  11. Zanka naj se konča po vnaprej določenem času, npr. 3 sekunde.
  12. +
  13. Ustavimo oba motorja.
  14. +
''' +] -- 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/printcolors/common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'robot/problems/introduction/printcolors') diff --git a/robot/problems/introduction/printcolors/common.py b/robot/problems/introduction/printcolors/common.py index 9b06575..79f4d2a 100644 --- a/robot/problems/introduction/printcolors/common.py +++ b/robot/problems/introduction/printcolors/common.py @@ -22,7 +22,7 @@ robot.connect_sensor( 'color' ) robot.move_steering( 'on') start = time.time() color = -1 -while time.time()-start < 2.1: +while time.time()-start < 1.2: c = robot.color_sensor_measure('color') if c!=color: print( c, color_table[c]) -- cgit v1.2.1