summaryrefslogtreecommitdiff
path: root/robot/problems/introduction/rotateback/sl.py
diff options
context:
space:
mode:
authorMartin Možina <martin.mozina@fri.uni-lj.si>2015-10-14 18:08:44 +0200
committerMartin Možina <martin.mozina@fri.uni-lj.si>2015-10-14 18:08:44 +0200
commit531bde7a2fe3d643e9b6ffe690405b6cc07c4964 (patch)
tree9fcdd54ec25cacc32cd5aaacfb731c174278fab8 /robot/problems/introduction/rotateback/sl.py
parent1b936a961e39b2a71b5a773776474446f0c58447 (diff)
parentb1deb24a05a380450ed9dc77c3155a16bd204dfc (diff)
Merge branch 'master' of 192.168.15.97:codeq-problems
Diffstat (limited to 'robot/problems/introduction/rotateback/sl.py')
-rw-r--r--robot/problems/introduction/rotateback/sl.py33
1 files changed, 33 insertions, 0 deletions
diff --git a/robot/problems/introduction/rotateback/sl.py b/robot/problems/introduction/rotateback/sl.py
new file mode 100644
index 0000000..269ea34
--- /dev/null
+++ b/robot/problems/introduction/rotateback/sl.py
@@ -0,0 +1,33 @@
+# coding=utf-8
+
+name = 'Drži smer'
+slug = 'Drži smer'
+
+description = '''\
+<p>Robot naj drži smer - če ga obrnemo iz začetne smeri, naj se zasuka nazaj v prvotno smer. Ob pritisku na stikalo, naj se resetira (smer nastavi na 0).</p>'''
+
+hint = {
+ 'mW_init':['''<p>Robota v programu predstavimo z mindstorms_widgets(): <code>robot = mindstorms_widgets()</code>.</p>'''],
+ 'connectMotorLeft':['''<p>Robotu priključi levi motor</p>''',
+ '''<p><code>robot.connect_motor( 'left' )</code>.</p>'''],
+ 'connectMotorRight':['''<p>Robotu priključi desni motor</p>''',
+ '''<p><code>robot.connect_motor( 'right' )</code>.</p>'''],
+ 'connectGyro':['''<p>Robotu priključi žiroskop</p>''',
+ '''<p><code>robot.connect_sensor( 'gyro' )</code>.</p>'''],
+ 'connectTouch':['''<p>Robotu priključi stikalo</p>''',
+ '''<p><code>robot.connect_sensor( 'touch' )</code>.</p>'''],
+ 'resetGyro':['''<p>Žiroskop na začetku in ob pritisku na stikalo resetiraj.</p>''',
+ '''<p><code>robot.reset_gyro()</code>.</p>'''],
+ 'setGyroMode':['''<p>Žiroskopu nastavi način delovanja na merjenje kotov.</p>''',
+ '''<p><code>robot.gyro_set_mode('angle')</code>.</p>'''],
+ 'gyroMeasure':['''<p>Preberi vrednost žiroskopa.</p>''',
+ '''<p><code>robot.gyro_sensor_measure()</code>.</p>'''],
+ 'ifTouch':['''<p>Preveri, če je stikalo pritisnjeno.</p>''',
+ '''<p><code>if robot.touch_sensor_measure():</code>.</p>'''],
+ 'lrPower':['''<p>Za obrat na mestu se morata kolesi vrteti z enako močjo in v nasprotni smeri.</p>''',
+ '''<p><code>robot.move_tank( 'on_for_seconds', lr_power=[hitrost, -hitrost], ... )</code>.</p>'''],
+ 'moveTank':['''<p>Robot naj se obrne na mestu.</p>''',
+ '''<p>Najprimernejša metoda za to je <code>move_tank</code></p>'''],
+ 'while':['''<p>Program naj teče v neskončni zanki.</p>''',
+ '''<p><code>while 1:</code></p>'''],
+}