Skip to content

Commit a077479

Browse files
authored
Merge branch 'master' into pypi
2 parents 44d3179 + 3559d01 commit a077479

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

adafruit_motor/stepper.py

+2-1
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:

tests/test_stepper.py

+4
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@ class Coil:
1414
def __init__(self):
1515
self._duty_cycle = 0
1616

17+
@property
18+
def frequency(self):
19+
return 1500
20+
1721
@property
1822
def duty_cycle(self):
1923
return self._duty_cycle

0 commit comments

Comments
 (0)