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
16 changes: 7 additions & 9 deletions adafruit_motor/stepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,13 @@ def __init__(
# set a safe pwm freq for each output
self._coil = (ain2, bin1, ain1, bin2)
for i in range(4):
if (
self._coil[i].frequency < 1500
and not self._coil[i].variable_frequency
):
raise ValueError(
"PWMOut outputs must either be set to at least "
"1500 Hz or allow variable frequency."
)
self._coil[i].frequency = 2000
if self._coil[i].frequency < 1500:
if not self._coil[i].variable_frequency:
raise ValueError(
"PWMOut outputs must either be set to at least "
"1500 Hz or allow variable frequency."
)
self._coil[i].frequency = 2000
if microsteps < 2:
raise ValueError("Microsteps must be at least 2")
if microsteps % 2 == 1:
Expand Down