Motor

Class Documentation

class compLib.Motor.Motor

Class used to control the motors

static all_off()

Turns of all motors

static power(port: int, percent: float)

Set specified motor to percentage power

Parameters
  • port – Port, which the motor is connected to. 0-3, 0 -> top left, 3 -> top right

  • percent – Percentage of max speed. between -100 and 100

Raises

IndexError

Examples

Driving straight (maybe)

from compLib.Motor import Motor

for port in range(0, 4):
    Motor.power(port, 50)