Skip to content

Add range status check #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 27, 2022
Merged

Conversation

caternuson
Copy link
Collaborator

Simple fix for #7.

The distance will now return None if range status is anything other than "valid".

VL53L1X Simple Test.
--------------------
Model ID: 0xEA
Module Type: 0xCC
Mask Revision: 0x10
Distance Mode: SHORT
Timing Budget: 100
--------------------
Distance: None cm
Distance: None cm
Distance: None cm
Distance: None cm
Distance: 14.0 cm
Distance: 18.2 cm
Distance: 33.1 cm
Distance: 46.3 cm
Distance: 25.2 cm
Distance: 9.9 cm
Distance: None cm
Distance: None cm
Distance: None cm

For now, check is simple and hard coded. In the future, could expand this out to check for other fail modes and report them back in some manor. Note that the values defined for status:

image

are not the same value as the register. See mapping in switch statement here:
https://github.com/adafruit/Adafruit_VL53L1X/blob/f2aaac89649823876451751a43cd1b036d65b22f/src/vl53l1x_class.cpp#L600-L644

That was used to determine that 0x09 register value is 0 range status, aka, VL53L1_RANGESTATUS_RANGE_VALID.

@caternuson caternuson requested a review from a team May 27, 2022 16:12
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@tannewt tannewt merged commit 31799b9 into adafruit:main May 27, 2022
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Jun 1, 2022
Updating https://github.com/adafruit/Adafruit_CircuitPython_floppy to 1.0.2 from 1.0.1:
  > Set language to "en" for documentation
  > Merge pull request adafruit/Adafruit_CircuitPython_floppy#4 from tekktrik/dev/lint-example
  > Update .pre-commit-config.yaml
  > Fix Docs badge
  > fix discord link for RTD
  > fix python version for rtd

Updating https://github.com/adafruit/Adafruit_CircuitPython_HT16K33 to 4.3.1 from 4.3.0:
  > Set language to "en" for documentation
  > Merge pull request adafruit/Adafruit_CircuitPython_HT16K33#99 from makermelissa/master
  > Switch to inclusive terminology
  > Increase min lines similarity
  > Patch .pre-commit-config.yaml
  > change discord badge
  > Patch: Replaced discord badge image
  > Updated gitignore
  > Update Black to latest.
  > Fixed readthedocs build

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L1X to 1.1.2 from 1.1.1:
  > Set language to "en" for documentation
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L1X#8 from caternuson/iss7_range_check
  > Increase min lines similarity
  > Patch .pre-commit-config.yaml

Updating https://github.com/adafruit/Adafruit_CircuitPython_Wiznet5k to 1.12.6 from 1.12.5:
  > Set language to "en" for documentation
  > Switch to inclusive terminology
  > Increase min lines similarity
  > Merge pull request adafruit/Adafruit_CircuitPython_Wiznet5k#58 from rstein/fix_sending_when_offset_greater_than_socksize
  > Patch .pre-commit-config.yaml
  > change discord badge
  > Patch: Replaced discord badge image
  > Update .gitignore

Updating https://github.com/adafruit/Adafruit_CircuitPython_BLE to 8.3.2 from 8.3.1:
  > Merge pull request adafruit/Adafruit_CircuitPython_BLE#167 from tekktrik/doc/hyperspecific-targets

Updating https://github.com/adafruit/Adafruit_CircuitPython_JWT to 1.2.7 from 1.2.6:
  > Set language to "en" for documentation
  > Merge pull request adafruit/Adafruit_CircuitPython_JWT#14 from Neradoc/add-deps
  > Switch to inclusive terminology
  > Increase min lines similarity
  > Patch .pre-commit-config.yaml

Updating https://github.com/adafruit/Adafruit_CircuitPython_Bundle/circuitpython_library_list.md to NA from NA:
  > Added the following libraries: Adafruit_CircuitPython_floppy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants