diff --git a/.travis.yml b/.travis.yml index 1e730d8..43c5d6d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,7 +23,8 @@ deploy: tags: true install: - - pip install pylint circuitpython-build-tools Sphinx sphinx-rtd-theme pytest + - pip install --force-reinstall pylint==1.9.2 + - pip install circuitpython-build-tools Sphinx sphinx-rtd-theme pytest script: - py.test diff --git a/adafruit_motor/stepper.py b/adafruit_motor/stepper.py index 3b6e106..2391e1d 100644 --- a/adafruit_motor/stepper.py +++ b/adafruit_motor/stepper.py @@ -75,7 +75,8 @@ def __init__(self, ain1, ain2, bin1, bin2, *, microsteps=16): # set a safe pwm freq for each output for i in range(4): - self._coil[i].frequency = 2000 + if self._coil[i].frequency < 1500: + self._coil[i].frequency = 2000 self._current_microstep = 0 if microsteps < 2: diff --git a/tests/test_stepper.py b/tests/test_stepper.py index 5832391..3f939b6 100644 --- a/tests/test_stepper.py +++ b/tests/test_stepper.py @@ -14,6 +14,10 @@ class Coil: def __init__(self): self._duty_cycle = 0 + @property + def frequency(self): + return 1500 + @property def duty_cycle(self): return self._duty_cycle