A library for controlling a Pololu VNH5019 Motor Controller Shield via USB Serial
Project description
VNH5019Controller Python Library
Classes:
Controller
A class for writing to the VNH5019 Motor Controller via either I2C or USB.
Constants:
CHANNEL_1
CHANNEL_2
BOTH
Functions:
init_serial(port_name)
Initialize a serial port for communication with the motor controller.
port_name (string): The name of the serial port to communicate over.
init_i2c(pre_existing_bus=None)
Initialize the serial bus for communication.
pre_existing_bus (SMBus): A pre-existing I2C bus if it exists.
Controller.write_speed(channel, value)
Write a speed value between -100 (full reverse) to 100 (full forward) to one or both channels.
channel (int): The channel whose speed we want to set. Must be one of CHANNEL_1, CHANNEL_2, or BOTH.
value (int): The speed we want to set between -100 to 100.
Returns (bytes): The bytes to be written to the controller.
Controller.write_brake(channel, value)
Write a brake value between 0 (coast) to 100 (max brake) to one or both channels.
channel (int): The channel whose speed we want to set. Must be one of CHANNEL_1, CHANNEL_2, or BOTH.
value (int): The brake we want to set between 0 to 100.
Returns (bytes): The bytes to be written to the controller.
Controller.write_mixed_command(speed_val, turn_val)
Write a mixed command to the motor controller.
speed_val (int): The speed we want to write between -100 (full reverse) to 100 (full forward).
turn_val (int): The turn value we want to write between -100 (max left) to 100 (max right).
Returns (bytes): The bytes to be written to the controller.
Controller.stop()
Stop both motors by applying max brakes.
Returns (bytes): The bytes to be written to the controller.
Controller.set_active()
Put the motor controller into an active state.
Returns (bytes): The bytes to be written to the controller.
Controller.set_standby()
Put the motor controller into standby.
Returns (bytes): The bytes to be written to the controller.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for VNH5019_Serial_Controller-0.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d9771774e3c5eaabb1592f4c6bc985f101f7805502cbdfd737ce9600666a2e6 |
|
MD5 | 13d0da39e3bb3bb653f14c8caa7fe3f6 |
|
BLAKE2b-256 | fe5f40200c491f6dd4f6abe9998b6ddfc47f6cccff1a14e5445947152e46abaf |
Hashes for VNH5019_Serial_Controller-0.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b3fd503c2fc68cfbb66e3ac4dd9fd0c3340ebcb602ed4d5a24166c11885465d4 |
|
MD5 | 7454a0e6f40af814e941e02e175fcbc4 |
|
BLAKE2b-256 | 40d34f9548d2de4b025be8a7af8e9b93206dbff37b5d5e3f3477b619c3ad7087 |