Skip to content

Add distance in cm #32

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
Oct 22, 2021
Merged

Add distance in cm #32

merged 1 commit into from
Oct 22, 2021

Conversation

caternuson
Copy link
Contributor

For #31.

This PR is non-breaking. A new distance property is added that returns value in units of cm. If we want to be breaking, can easily change this to replace the existing range property instead.

Tested on Itsy:

Adafruit CircuitPython 7.0.0 on 2021-09-20; Adafruit ItsyBitsy M4 Express with samd51g19
>>> import board
>>> import adafruit_vl53l0x
>>> vl = adafruit_vl53l0x.VL53L0X(board.I2C())
>>> vl.distance
23.1
>>> vl.distance
18.7
>>> vl.distance
14.4
>>> vl.distance
11.4
>>> vl.distance
10.6
>>> 

@caternuson caternuson requested a review from a team October 22, 2021 20:33
Copy link

@KeithTheEE KeithTheEE left a comment

Choose a reason for hiding this comment

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

Looks good to me. Adding a distance property keeps the experience similar to that of other sensors like the HC-SR04.

Copy link
Member

@gamblor21 gamblor21 left a comment

Choose a reason for hiding this comment

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

As a Canadian using metric I approve of this change. It all looks good too.

@gamblor21 gamblor21 merged commit 4e8ab96 into adafruit:main Oct 22, 2021
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Oct 26, 2021
Updating https://github.com/adafruit/Adafruit_CircuitPython_GPS to 3.9.3 from 3.9.2:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_GPS#71 from theendlessriver13/update-pre-commit

Updating https://github.com/adafruit/Adafruit_CircuitPython_VL53L0X to 3.4.0 from 3.3.7:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_VL53L0X#32 from caternuson/iss31
  > Globally disabled consider-using-f-string pylint check
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template
  > "Increase duplicate code check threshold "

Updating https://github.com/adafruit/Adafruit_CircuitPython_Debouncer to 1.3.12 from 1.3.11:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_Debouncer#31 from tjpeden/patch-1
  > Added pylint disable for f-strings in tests directory
  > Globally disabled consider-using-f-string pylint check
  > Moved default branch to main
  > Moved CI to Python 3.7
  > Added help text and problem matcher
  > Added pull request template

Updating https://github.com/adafruit/Adafruit_CircuitPython_MiniMQTT to 5.1.3 from 5.1.2:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_MiniMQTT#94 from dhalbert/socket-arg-fix
  > Globally disabled consider-using-f-string pylint check

Updating https://github.com/adafruit/Adafruit_CircuitPython_Requests to 1.10.1 from 1.10.0:
  > add docs link to readme
  > Merge pull request adafruit/Adafruit_CircuitPython_Requests#82 from dhalbert/socket-arg-list
  > Globally disabled consider-using-f-string pylint check
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.

3 participants