diff options
Diffstat (limited to 'robot/problems/introduction/square20/naloga04_square20.py')
-rw-r--r-- | robot/problems/introduction/square20/naloga04_square20.py | 21 |
1 files changed, 21 insertions, 0 deletions
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 |