Skip to main content

CircuitPython helper library for PWM/Servo FeatherWing, Shield, and Pi HAT and Bonnet kits.

Project description

Introduction

Documentation Status Discord Build Status Code Style: Ruff

CircuitPython helper library for the PWM/Servo FeatherWing, Shield and Pi HAT and Bonnet kits.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

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 adafruit-circuitpython-servokit

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

sudo pip3 install adafruit-circuitpython-servokit

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .venv
source .venv/bin/activate
pip3 install adafruit-circuitpython-servokit

Usage Example

import time
from adafruit_servokit import ServoKit

# Set channels to the number of servo channels on your kit.
# 8 for FeatherWing, 16 for Shield/HAT/Bonnet.
kit = ServoKit(channels=8)

kit.servo[0].angle = 180
kit.continuous_servo[1].throttle = 1
time.sleep(1)
kit.continuous_servo[1].throttle = -1
time.sleep(1)
kit.servo[0].angle = 0
kit.continuous_servo[1].throttle = 0

Documentation

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

For information on building library documentation, please check out this guide.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

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

adafruit_circuitpython_servokit-1.3.24.tar.gz (23.8 kB view details)

Uploaded Source

Built Distribution

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

File details

Details for the file adafruit_circuitpython_servokit-1.3.24.tar.gz.

File metadata

File hashes

Hashes for adafruit_circuitpython_servokit-1.3.24.tar.gz
Algorithm Hash digest
SHA256 5c75017f91573540db3edde9f4fb09f286e976d49ee5ed0371192841b02aca40
MD5 c7ff00391cd890e5076413b76ce48688
BLAKE2b-256 bee5c3e1ebb578a7dab10eae98a48ed10dc044a02f212607df4324048f11a11c

See more details on using hashes here.

File details

Details for the file adafruit_circuitpython_servokit-1.3.24-py3-none-any.whl.

File metadata

File hashes

Hashes for adafruit_circuitpython_servokit-1.3.24-py3-none-any.whl
Algorithm Hash digest
SHA256 f75490c5b6d2a2b5e79d7d4258a9b85932d17c0c005cab15ca80a18857b64cc7
MD5 cd6847d8ef3a3aad0ce178f4a3ba531c
BLAKE2b-256 3f25a4ffcd42d97f44b95e64f843819f97efe2d1feb30fcf4e175d154778f764

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