Skip to content

Commit 6ff766c

Browse files
committed
don't set stepper freq if it's already OK
1 parent e0b709f commit 6ff766c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

adafruit_motor/stepper.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ def __init__(self, ain1, ain2, bin1, bin2, *, microsteps=16):
7575

7676
# set a safe pwm freq for each output
7777
for i in range(4):
78-
self._coil[i].frequency = 2000
78+
if self._coil[i].frequency < 1500:
79+
self._coil[i].frequency = 2000
7980

8081
self._current_microstep = 0
8182
if microsteps < 2:

0 commit comments

Comments
 (0)