We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents f02e320 + bdf122d commit f2edb76Copy full SHA for f2edb76
adafruit_motor/stepper.py
@@ -113,8 +113,15 @@ def __init__(
113
# set a safe pwm freq for each output
114
self._coil = (ain2, bin1, ain1, bin2)
115
for i in range(4):
116
- if self._coil[i].frequency < 1500:
117
- self._coil[i].frequency = 2000
+ if (
+ self._coil[i].frequency < 1500
118
+ and not self._coil[i].variable_frequency
119
+ ):
120
+ raise ValueError(
121
+ "PWMOut outputs must either be set to at least "
122
+ "1500 Hz or allow variable frequency."
123
+ )
124
+ self._coil[i].frequency = 2000
125
if microsteps < 2:
126
raise ValueError("Microsteps must be at least 2")
127
if microsteps % 2 == 1:
0 commit comments