Robotický simulátor PRIA IDE: Rozdiel medzi revíziami
Zo stránky SensorWiki
Bez shrnutí editace |
Bez shrnutí editace |
||
Riadok 6: | Riadok 6: | ||
</tabs> | </tabs> | ||
--> | --> | ||
<tabs> | <tabs> | ||
<tab name="Simulator 1"> | <tab name="Simulator 1"> | ||
[[Súbor:priaIDE05.png]] | [[Súbor:priaIDE05.png]] | ||
</tab> | |||
<tab name="Python"><source lang="python" style="background: LightYellow;"> | <tab name="Python"><source lang="python" style="background: LightYellow;"> | ||
Verzia z 09:51, 27. november 2022
import math
hedgehog.commands(
hedgehog.move_motor_cmd(0, 1000),
hedgehog.move_motor_cmd(1, 1000),
)
sleep(1)
hedgehog.commands(
hedgehog.brake_cmd(0),
hedgehog.brake_cmd(1),
)
hedgehog.commands(
hedgehog.move_motor_cmd(0, 1000),
hedgehog.move_motor_cmd(1, -1000),
)
sleep(1)
hedgehog.commands(
hedgehog.brake_cmd(0),
hedgehog.brake_cmd(1),
)
print(''.join([str(x) for x in ['SEN: ', round(hedgehog.get_analog(4)), ' / ', round(hedgehog.get_analog(5)), ' / ', round(hedgehog.get_analog(6))]]))