diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index fff3aa9..1dad804 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -40,7 +40,7 @@ jobs: source actions-ci/install.sh - name: Pip install pylint, black, & Sphinx run: | - pip install --force-reinstall pylint==1.9.2 black==19.10b0 Sphinx sphinx-rtd-theme + pip install --force-reinstall pylint black==19.10b0 Sphinx sphinx-rtd-theme - name: Library version run: git describe --dirty --always --tags - name: PyLint diff --git a/adafruit_tfmini.py b/adafruit_tfmini.py index 7e969da..1addce2 100644 --- a/adafruit_tfmini.py +++ b/adafruit_tfmini.py @@ -45,15 +45,16 @@ __version__ = "0.0.0-auto.0" __repo__ = "https://github.com/adafruit/Adafruit_CircuitPython_TFmini.git" -_STARTCONFIG = b'\x42\x57\x02\x00\x00\x00\x01\x02' -_STARTREPLY = b'\x57\x02\x01\x00\x00\x01\x02' # minus header 0x42 -_CONFIGPARAM = b'\x42\x57\x02\x00' -_ENDCONFIG = b'\x42\x57\x02\x00\x00\x00\x00\x02' -_ENDREPLY = b'\x42\x57\x02\x01\x00\x00\x00\x02' +_STARTCONFIG = b"\x42\x57\x02\x00\x00\x00\x01\x02" +_STARTREPLY = b"\x57\x02\x01\x00\x00\x01\x02" # minus header 0x42 +_CONFIGPARAM = b"\x42\x57\x02\x00" +_ENDCONFIG = b"\x42\x57\x02\x00\x00\x00\x00\x02" +_ENDREPLY = b"\x42\x57\x02\x01\x00\x00\x00\x02" MODE_SHORT = 2 MODE_LONG = 7 + class TFmini: """TF mini communication module, use with just RX or TX+RX for advanced command & control. @@ -87,7 +88,9 @@ def distance(self): # get remaining packet data = self._uart.read(8) # check first byte is magicbyte - frame, dist, self._strength, self._mode, _, checksum = struct.unpack("