L298N Driver Python Package
This package provides a Python interface for controlling the L298N H-Bridge Motor Driver.
Prerequisites
This library requires the sx1509_gpio_expander library. You can install it using pip:
pip install sx1509_gpio_expander
Installation
Install the package using pip:
pip install l298n-driver
Usage
from sx1509_gpio_expander import SX1509
from l298n_driver import L298N
import board
# Configure I2C
i2c = board.I2C()
# Create an instance of the SX1509 GPIO expander
IOExpander0 = SX1509.SX1509(i2c, 0x3E)
# Create an instance of the L298N motor driver
# The parameters are the IO expander, and the pin numbers for motor input 1, motor input 2, and motor speed control
motor = L298N.L298N(IOExpander0, 1, 2, 3)
# Use the motor driver
# The smartDrive function sets the motor speed and direction simultaneously
# Just set the speed to a value between (-255-255) and the function will automatically call the set_speed() function and according to the given speed value also call the forward() or backward() function
motor.smartDrive(255)
License
This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the LICENSE file for details.
Release files for l298n-driver 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| l298n_driver-0.1.0.tar.gz | 16.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| l298n_driver-0.1.0-py2.py3-none-any.whl | Python 3, Python 2 | none | any | Details |
Total release size:31.9 kB
Release files / l298n_driver-0.1.0.tar.gz
| Download URL | l298n_driver-0.1.0.tar.gz |
|---|---|
| Size | 16.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b9cf108851f547d4221c7c338c658f418f258064c4c4d6d34378cd0b1c8a8f01
|
|
BLAKE2b-256 checksum How to use checksums |
cb1399345d19e2a26b4a2ec10d85f540e8dfdacd877bf305df43b3ff5c69e3e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.0
|
Release files / l298n_driver-0.1.0-py2.py3-none-any.whl
| Download URL | l298n_driver-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
7743aa185849df47cc4df6cc87685d2b5e5367c0757bef2399b983d8d37b44b1
|
|
BLAKE2b-256 checksum How to use checksums |
d03628eace421b414feb8bb540e721d5873a761d0e6c288fd43620b63e9c6b81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.8.0
|