Skip to content

Commit 2299dba

Browse files
authored
Merge pull request #44 from dhalbert/i2c-speed-doc
improve doc and add note to use higher i2C bus speed
2 parents a54d2bd + 5056419 commit 2299dba

File tree

1 file changed

+15
-8
lines changed

1 file changed

+15
-8
lines changed

adafruit_motorkit.py

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,10 @@
1616
1717
**Hardware:**
1818
19-
"* `DC Motor + Stepper FeatherWing <https://www.adafruit.com/product/2927>`_"
20-
"* `Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit
21-
<https://www.adafruit.com/product/1438>`_"
22-
"* `Adafruit DC & Stepper Motor HAT for Raspberry Pi - Mini Kit
23-
<https://www.adafruit.com/product/2348>`_"
19+
* `DC Motor + Stepper FeatherWing <https://www.adafruit.com/product/2927>`_
20+
* `Adafruit Motor/Stepper/Servo Shield for Arduino v2 Kit <https://www.adafruit.com/product/1438>`_
21+
* `Adafruit DC & Stepper Motor HAT for Raspberry Pi - Mini Kit
22+
<https://www.adafruit.com/product/2348>`_
2423
2524
**Software and Dependencies:**
2625
@@ -52,10 +51,18 @@
5251
class MotorKit:
5352
"""Class representing an Adafruit DC & Stepper Motor FeatherWing, Shield or Pi Hat kit.
5453
55-
Automatically uses the I2C bus on a Feather, Metro or Raspberry Pi if no I2C bus
56-
is supplied.
54+
:param int address: I2C address of PCA9685 PWM controller. Default address is ``0x60``.
55+
:param busio.I2C i2c: I2C bus object to use. If not specified, use ``board.I2C()``.
5756
58-
Alternately, if using with multiple I2C devices, you can specify the I2C bus."""
57+
.. note::
58+
``board.I2C()`` uses the default I2C bus frequency of 100 kHz. To speed up
59+
motor control, use an I2C bus frequency of 400 KHz, or if available, 1 MHz.
60+
The PCA9685 controller supports both of these higher speeds.
61+
This will noticeably speed up stepper motor operation when many steps are requested.
62+
63+
:param int steppers_microsteps: Number of microsteps per step for stepper motors. Default is 16.
64+
:param float pwm_frequency: defaults to 1600 Hz
65+
"""
5966

6067
def __init__(
6168
self,

0 commit comments

Comments
 (0)