Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Return value of read_gpio_pin_analogue_value is unclear #315

Open
kierdavis opened this issue Jun 18, 2019 · 3 comments
Open

Return value of read_gpio_pin_analogue_value is unclear #315

kierdavis opened this issue Jun 18, 2019 · 3 comments
Labels
bug Something isn't working documentation Documentation

Comments

@kierdavis
Copy link
Contributor

It is not clearly documented what the scale of the return value of GPIOPinInterface.read_gpio_pin_analogue_value should be. Is it

  • between 0 and 1?
  • between 0 and the maximum ADC reading? (usually 255 or 1023 for an arduino)
  • between 0 and the reference voltage? (usually 5 V for an arduino)

I think the last option is the most useful to the user.

https://github.com/j5api/j5/blob/master/j5/components/gpio_pin.py#L76

@kierdavis kierdavis added bug Something isn't working documentation Documentation labels Jun 18, 2019
@trickeydan
Copy link
Contributor

The latter was my intention when I wrote the interface.

@trickeydan
Copy link
Contributor

We should clarifiy this in code, but between 0 and the reference voltage? (usually 5 V for an arduino) is what it should be

@kierdavis
Copy link
Contributor Author

Makes sense to me.

I think (not sure since it's been a while since I looked at this) that there's a few places in the code that don't follow this, so we should look through and make sure the right scale is being used consistently throughout the codebase.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working documentation Documentation
Projects
None yet
Development

No branches or pull requests

2 participants