Skip to content

improve doc and add note to use higher i2C bus speed #44

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 15 additions & 8 deletions adafruit_motorkit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,10 @@

**Hardware:**

"* `DC Motor + Stepper FeatherWing <https://www.adafruit.com/product/2927>`_"
"* `Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit
<https://www.adafruit.com/product/1438>`_"
"* `Adafruit DC & Stepper Motor HAT for Raspberry Pi - Mini Kit
<https://www.adafruit.com/product/2348>`_"
* `DC Motor + Stepper FeatherWing <https://www.adafruit.com/product/2927>`_
* `Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit <https://www.adafruit.com/product/1438>`_
* `Adafruit DC & Stepper Motor HAT for Raspberry Pi - Mini Kit
<https://www.adafruit.com/product/2348>`_

**Software and Dependencies:**

Expand Down Expand Up @@ -52,10 +51,18 @@
class MotorKit:
"""Class representing an Adafruit DC & Stepper Motor FeatherWing, Shield or Pi Hat kit.

Automatically uses the I2C bus on a Feather, Metro or Raspberry Pi if no I2C bus
is supplied.
:param int address: I2C address of PCA9685 PWM controller. Default address is ``0x60``.
:param busio.I2C i2c: I2C bus object to use. If not specified, use ``board.I2C()``.

Alternately, if using with multiple I2C devices, you can specify the I2C bus."""
.. note::
``board.I2C()`` uses the default I2C bus frequency of 100 kHz. To speed up
motor control, use an I2C bus frequency of 400 KHz, or if available, 1 MHz.
The PCA9685 controller supports both of these higher speeds.
This will noticeably speed up stepper motor operation when many steps are requested.

:param int steppers_microsteps: Number of microsteps per step for stepper motors. Default is 16.
:param float pwm_frequency: defaults to 1600 Hz
"""

def __init__(
self,
Expand Down