Example 5 Time To Turn ====================== Simulation ----------- .. image:: ../tutorial/code5.gif :alt: not found :align: center Real Life --------- .. image:: ../tutorial/code5real.gif :alt: not found :align: center What does the code do? ---------------------- In this code the robot moves forward for 1200 ms using mav at 1500 velocity, then curve right for 1500ms(1000 and 1500 velocity) then curve left for 2000ms(1500 and 500 velocity) Functions Used -------------- mav( motor port, velocity) msleep(distance in ms) Function Implementation *********************** .. code-block:: python :linenos: #!/usr/bin/python3 import os, sys sys.path.append("/usr/lib") from kipr import* def main(): mav(0, 1500) mav(3, 1500) msleep(1200) mav(0, 1000) mav(3, 1500) msleep(1500) mav(0, 1500) mav(3, 500) msleep(2000) if __name__ == "__main__": main() Rookie Tips ----------- By having one motor move at a slower speed, the robot will start to curve! This will let your robot move in different directions! If you want your robot to turn without curving, try having one motor be positive and the other negative.