arduino-libraries / ArduinoMotorCarrier

GNU Lesser General Public License v3.0
16 stars 15 forks source link

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

Open gbr1 opened 2 years ago

gbr1 commented 2 years ago

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

Why getConverted method doesn't return 7.41V?

Thank you in advance!

per1234 commented 2 years ago

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.