-
Notifications
You must be signed in to change notification settings - Fork 11
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
Adding Sharp GP2Y0A21F_5V_DS #17
Conversation
Hey @cgo, thanks for taking the time to make this contribution so others can benefit from it! The code changes look good to me and the CI checks passed on all boards. Do you have the "advertised" range (in cm) of the sensor and would you mind also updating the information on the README (list of models, coefficients table and analog range table)? Thanks! |
Hey @DrGFreeman, wow you're running a CI for this; nice! I also noticed that the values for the other sensors in the README are given in mm; the output for the one I added is in cm. Given the apparent accuracy, I think that is more than enough; do you want all of them to be in mm? |
This is using cm for the added sensor model.
Looks like my emacs has cleaned up some whitespace -- if that's bothersome, I can undo that too. |
Hi @cgo, thanks for the update of the README. No problem with the whitespaces, it's cleaner like this actually.
Not much merit on my part, I just copied what Pololu are doing for their Arduino library. Basically checks that the example sketches compile OK, no more but useful nevertheless.
Agree, this is mostly for the list of models in the README to help people identify which sensor they have as it's easy to get mixed up in the Sharp model numbers. The range in cm can help confirm the model is the right one. I see you added it in the README, that's perfect. Thanks.
That's fine, especially with a power function, extrapolation is not as bad as with a polynomial which can give unexpected results outside of the calibrated range.
I would prefer the output to be in mm for consistency with the other models (the Library Reference says the output of the |
Also, I forgot to ask if you could add the model in the Thanks again! |
I think I addressed all issues, let me know if there's something else or feel free to make modifications :) |
Restore double trailing whitespaces (markdown line breaks) to maintain original formatting.
Tab separator is required by Arduino IDE.
Thanks @cgo. I made minor modifications to maintain the line breaks in the README file and tab spacing in This is ready to merge. Thanks again for your contribution! I will proceed to make a new release (#18) shortly so the new version is available in the Arduino Library Manager. |
You're welcome. Thanks for making this library available!
Sweet! |
I have added values for the sensor that I found in my junk box. The values are from a power function fit that I did
by reading the values roughly from the plot provided in the datasheet. There is unfortunately no actual data.
The readings are not super accurate, but good enough for my purposes.