diff options
author | Martin Možina <martin.mozina@fri.uni-lj.si> | 2015-10-14 18:08:44 +0200 |
---|---|---|
committer | Martin Možina <martin.mozina@fri.uni-lj.si> | 2015-10-14 18:08:44 +0200 |
commit | 531bde7a2fe3d643e9b6ffe690405b6cc07c4964 (patch) | |
tree | 9fcdd54ec25cacc32cd5aaacfb731c174278fab8 /robot/problems/introduction/square20/naloga04_square20.py | |
parent | 1b936a961e39b2a71b5a773776474446f0c58447 (diff) | |
parent | b1deb24a05a380450ed9dc77c3155a16bd204dfc (diff) |
Merge branch 'master' of 192.168.15.97:codeq-problems
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 |