Skip to content

fmorton/robot-python-motor-controller

Repository files navigation

Overview

docs Documentation Status
package

General python support for single and dual motor controllers.

  • Free software: MIT License

Installation

pip install robot-motor-controller

You can also install the in-development version with:

pip install https://github.com/fmorton/robot-python-hummingbird/archive/main.zip

Motor Controller Example with a Birdbrain Hummingbird

from robot.hummingbird import Hummingbird
from robot.l298n_dual_motor_controller import L298nDualMotorController
from time import sleep

hummingbird = Hummingbird()

motors = L298nDualMotorController(hummingbird)

motors.move_left_motor(40)  # left motor forward
sleep(1.0)
motors.move_left_motor(0)  # stop left motor

motors.move_right_motor(-40)  # right motor backwards
sleep(1.0)

motors.move(50, 50)  # move both motors forward
sleep(1.0)

motors.stop()

Testing

To run all the tests run:

pytest

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages