Skip to content

jposada202020/MicroPython_MOTOR

Repository files navigation

Introduction

Documentation Status micropython latest version on PyPI Total PyPI downloads Code Style: Black

MicroPython Helpers for controlling PWM based motors and servos This has been adapted to use in the Raspberry Pi Pico from the excellent Adafruit_CircuitPython_Motor Library here: https://github.com/adafruit/Adafruit_CircuitPython_Motor

This library can work with other MCU (Not tested) that used the following PWM methods:

  • freq
  • duty_u16

Installing with mip

To install using mpremote

mpremote mip install github:jposada202020/MicroPython_MOTOR

To install directly using a WIFI capable board

mip.install("github:jposada202020/MicroPython_MOTOR")

Installing Library Examples

If you want to install library examples:

mpremote mip install github:jposada202020/MicroPython_MOTOR/examples.json

To install directly using a WIFI capable board

mip.install("github:jposada202020/MicroPython_MOTOR/examples.json")

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install micropython-motor

To install system-wide (this may be required in some cases):

sudo pip3 install micropython-motor

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .env/bin/activate
pip3 install micropython-motor

Usage Example

Take a look at the examples directory

Documentation

API documentation for this library can be found on Read the Docs.