Skip to main content

Python interface for PWM servo driver

Project description

PWM Servo Driver Python Package

This package provides a Python interface for controlling servos using Pulse Width Modulation (PWM).

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 pwm-servo-driver

Usage

from sx1509_gpio_expander import SX1509
from pwm_servo_driver import Servo
import board

# Configure I2C
i2c = board.I2C() 

# Create an instance of the SX1509 GPIO expander
IOExpander0 = SX1509.SX1509(i2c, 0x3F)

# Create an instance of the PWM servo driver
# The parameters are the IO expander, and the pin number for the servo
servo = Servo.Servo(IOExpander0, 1)

# Use the servo driver
# The setPosition function sets the servo angle
# Just set the angle to a value between (0-180) and the function will automatically adjust the PWM signal
servo.setPosition(90)

License

This project is licensed under the GNU GENERAL PUBLIC LICENSE - see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pwm_servo_driver-0.1.0.tar.gz (15.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pwm_servo_driver-0.1.0-py2.py3-none-any.whl (15.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file pwm_servo_driver-0.1.0.tar.gz.

File metadata

  • Download URL: pwm_servo_driver-0.1.0.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.8.0

File hashes

Hashes for pwm_servo_driver-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8bb5fd5093aea338d9ab7066c6c901090cdecfc44e9dc116953aca41eb2933cd
MD5 590f6d07122244ece0f47e37bb327118
BLAKE2b-256 ff5d780b9d63ea46856d803fdd0f82bcd84240541ff77ac8cb51b503a2334a7d

See more details on using hashes here.

File details

Details for the file pwm_servo_driver-0.1.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for pwm_servo_driver-0.1.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5ce8f9b38562c89add8190b11cf65552aa6d22fd9d48d22b28951dbae99509e4
MD5 e27cc0975050c88170897637de8936f5
BLAKE2b-256 26aab4d359d2a37c5be56f69f3dc8ba7c2f69b12485720972c5af2df8cb06917

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page