From 6ff766c4e8cf56b21d69f6756c48bf6754217fce Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 31 Jul 2018 13:35:54 -0400 Subject: [PATCH 1/2] don't set stepper freq if it's already OK --- adafruit_motor/stepper.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: From f3d8e056751bf4bd3fb2129e21c8e95b3b2b745a Mon Sep 17 00:00:00 2001 From: Dan Halbert Date: Tue, 31 Jul 2018 15:52:06 -0400 Subject: [PATCH 2/2] pylint version to 1.9.5; fix test issues --- .travis.yml | 3 ++- tests/test_stepper.py | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) 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/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