Skip to content

Commit 6830041

Browse files
authored
Merge pull request #7 from adafruit/dm-stepper
DM: explicitly set pwm freq
2 parents 4fd941b + 6699d76 commit 6830041

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

adafruit_motor/stepper.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ class StepperMotor:
7373
def __init__(self, ain1, ain2, bin1, bin2, *, microsteps=16):
7474
self._coil = (ain2, bin1, ain1, bin2)
7575

76+
# set a safe pwm freq for each output
77+
for i in range(4):
78+
self._coil[i].frequency = 2000
79+
7680
self._current_microstep = 0
7781
if microsteps < 2:
7882
raise ValueError("Microsteps must be at least 2")

0 commit comments

Comments
 (0)