Skip to content
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
6 changes: 3 additions & 3 deletions adafruit_servokit.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
"""

import board
import busio
from adafruit_pca9685 import PCA9685

__version__ = "0.0.0-auto.0"
Expand All @@ -77,12 +76,13 @@ class ServoKit:
Default reference clock speed is ``25000000``.

"""
def __init__(self, *, channels, address=0x40, reference_clock_speed=25000000):
def __init__(self, *, channels, i2c=None, address=0x40, reference_clock_speed=25000000):
if channels not in [8, 16]:
raise ValueError("servo_channels must be 8 or 16!")
self._items = [None] * channels
self._channels = channels
i2c = busio.I2C(board.SCL, board.SDA)
if i2c is None:
i2c = board.I2C()
self._pca = PCA9685(i2c, address=address, reference_clock_speed=reference_clock_speed)
self._pca.frequency = 50

Expand Down