From 1e5d42ba53ea0c631dbc6f21887839c91571ebca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=BDabkar?= Date: Tue, 13 Oct 2015 12:24:41 +0200 Subject: Uvodne vaje za robotiko --- .../introduction/square20/naloga04_square20.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 robot/problems/introduction/square20/naloga04_square20.py (limited to 'robot/problems/introduction/square20/naloga04_square20.py') diff --git a/robot/problems/introduction/square20/naloga04_square20.py b/robot/problems/introduction/square20/naloga04_square20.py new file mode 100644 index 0000000..171c4b8 --- /dev/null +++ b/robot/problems/introduction/square20/naloga04_square20.py @@ -0,0 +1,21 @@ +#!/usr/bin/python + +print "Robot naj enkrat prevozi kvadrat s stranico 20 cm." + +import time +from ev3dev import * +from mindstorms_widgets import mindstorms_widgets + +robot = mindstorms_widgets() +robot.connect_motor( 'left' ) +robot.connect_motor( 'right' ) + +turntime = .95 +robot.move_steering( 'on_for_seconds', direction=0, power=20, seconds=2 ) +robot.move_tank( 'on_for_seconds', lr_power=[20,-20], seconds=turntime ) +robot.move_steering( 'on_for_seconds', direction=0, power=20, seconds=2 ) +robot.move_tank( 'on_for_seconds', lr_power=[20,-20], seconds=turntime ) +robot.move_steering( 'on_for_seconds', direction=0, power=20, seconds=2 ) +robot.move_tank( 'on_for_seconds', lr_power=[20,-20], seconds=turntime ) +robot.move_steering( 'on_for_seconds', direction=0, power=20, seconds=2 ) +robot.move_tank( 'on_for_seconds', lr_power=[20,-20], seconds=turntime ) \ No newline at end of file -- cgit v1.2.1