Skip to main content

motor-like-arduino

Arduino-style DC motor control for Python.

Control motors connected to an Arduino running StandardFirmata using simple, intuitive commands inspired by the Arduino ecosystem.

from motor_like_arduino import Board

board = Board("/dev/ttyUSB0")

motor = board.attach_motor(2, 4, 11)

motor.forward(100)

Why motor-like-arduino?

Most Python motor libraries expose low-level motor driver details.

motor-like-arduino focuses on simplicity:

motor.forward(100)
motor.backward(50)
motor.stop()
motor.brake()

No PWM calculations.

No complicated setup.

Just simple motor control.


Installation

pip install motor-like-arduino

Quick Start

from motor_like_arduino import Board
import time

board = Board("/dev/ttyUSB0")

motor = board.attach_motor(
    2,  # Direction Pin 1
    4,  # Direction Pin 2
    11  # PWM Pin
)

motor.forward(100)

time.sleep(2)

motor.stop()

board.close()

Multiple Motors

from motor_like_arduino import Board

board = Board("/dev/ttyUSB0")

left_motor = board.attach_motor(
    2,
    4,
    11
)

right_motor = board.attach_motor(
    5,
    3,
    10
)

left_motor.forward(50)
right_motor.forward(100)

Features

  • Simple Arduino-inspired API
  • Percentage-based speed control (0-100)
  • Forward and backward movement
  • Stop and brake support
  • Multiple motors per board
  • Optional TB6612FNG standby support
  • Automatic speed validation
  • Safe board shutdown
  • Context manager support
  • Custom exceptions
  • Built on top of pyFirmata2

Supported Motor Drivers

Any motor driver that uses:

  • 2 direction pins
  • 1 PWM pin

Including:

  • TB6612FNG
  • L293D
  • L298N
  • MX1508

Optional TB6612FNG Standby Support

board = Board(
    "/dev/ttyUSB0",
    stby=6
)
board.sleep()
board.wake()

Included Examples

The repository includes ready-to-run examples:

  • Single Motor Control
  • Dual Motor Control
  • Tank Drive
  • Keyboard Control

Documentation

Complete documentation, API reference, guides, and examples are available in the project wiki.


Requirements

  • Python 3.8+
  • Arduino running StandardFirmata

Author

Vihaan Parlikar


Metadata

Release files for motor-like-arduino 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for motor-like-arduino 0.1.0
File Size Uploaded
motor_like_arduino-0.1.0.tar.gz 4.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for motor-like-arduino 0.1.0
File Interpreter ABI Platform
motor_like_arduino-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / motor_like_arduino-0.1.0.tar.gz

Download URL motor_like_arduino-0.1.0.tar.gz
Size 4.1 kB
Tags Source
SHA-256 checksum
How to use checksums
a8400b04e35060d1bd9ee5b0aa0120b1e60cb5dd98c0fb6a50e7b04550112249
BLAKE2b-256 checksum
How to use checksums
a3ad118a6ca9320d36822e45b9f0eda12212d3eb927be2f05cbeaa97c1d27773
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 15, 2026.

Transparency log

Release files / motor_like_arduino-0.1.0-py3-none-any.whl

Download URL motor_like_arduino-0.1.0-py3-none-any.whl
Size 5.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5812141c54566bd9e0ba86405c6360d5ed01fda4c78714c111c10943a35de932
BLAKE2b-256 checksum
How to use checksums
16cb64c339783c2ab2f8c3fa60bf2e271c98c401118151ad3dc8e88d0c0cba49
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jun 15, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page