Skip to content
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

battery voltage strange behaviour when using battery.getConverted() on MKR Motor Carrier #54

Open
gbr1 opened this issue Nov 6, 2022 · 1 comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project

Comments

@gbr1
Copy link

gbr1 commented Nov 6, 2022

Hi!
I have connected a 2s battery to the carrier.
I discovered that:

  • using (float)battery.getRaw() / 77 I obtain 7.41V
  • (float)battery.getConverted() gives 7.00V
  • (float)battery.getFiltered() gives 7.00V
    Using an external voltmeter, measure is 7.41V

Why getConverted method doesn't return 7.41V?

Thank you in advance!

@per1234 per1234 added type: imperfection Perceived defect in any part of project topic: code Related to content of the project itself labels Nov 6, 2022
@per1234
Copy link
Contributor

per1234 commented Nov 6, 2022

Thanks for your report @gbr1. The reason is that the developers used an integer type in the library source code. Clearly that is not an appropriate API design for these functions.

Fortunately it is only a convenience function and the user is still able to calculate a usable battery voltage value in their own code as you did.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: code Related to content of the project itself type: imperfection Perceived defect in any part of project
Projects
None yet
Development

No branches or pull requests

2 participants