Skip to content

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

Open
@gbr1

Description

@gbr1

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!

Activity

added
type: imperfectionPerceived defect in any part of project
topic: codeRelated to content of the project itself
on Nov 6, 2022
per1234

per1234 commented on Nov 6, 2022

@per1234
Contributor

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: codeRelated to content of the project itselftype: imperfectionPerceived defect in any part of project

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @per1234@gbr1

        Issue actions

          battery voltage strange behaviour when using battery.getConverted() on MKR Motor Carrier · Issue #54 · arduino-libraries/ArduinoMotorCarrier