summaryrefslogtreecommitdiff
path: root/robot/problems/introduction/square20/naloga04_square20.py
blob: 171c4b8eeb2126cbb5a2ca11bed8601afeca36ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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 )