Example 1 Moving Forward Using motor

Simulation

not found

Real Life

not found

What does code do?

In this code, the robot moves forward for 800ms at 80% speed.

Functions Used

motor( motor port, speed)

msleep( duration in ms)

Function Implementation

 1#!/usr/bin/python3
 2import os, sys
 3sys.path.append("/usr/lib")
 4from kipr import*
 5
 6def main():
 7   motor(0, 80)
 8   motor(3, 80)
 9   msleep(800)
10
11if __name__ == "__main__":
12   main()

Rookie Tips

You may need to register a team to botball official, in order to access the 3D simulator. In the 3D simulator, port 0 is the left motor, while port 3 is the right motor.

not found

All of our codes are in python. Double check you are also using python before running our codes.