SignalK / SensESP

Universal Signal K sensor framework for the ESP32 platform
https://signalk.org/SensESP/
Apache License 2.0
151 stars 81 forks source link

analog_input.cpp example outputs percentage instead of ratio #484

Closed ba58smith closed 2 years ago

ba58smith commented 2 years ago

When originally created, this example output its value as a percentage, from 0 to 100.

When the ability to add metadata to the SKOutput constructor was added, the example had ratio added as its unit in the metadata: ->connect_to(new SKOutputNumber(sk_path, "", new SKMetadata("ratio")));

So I think the linear transform's multiplier value needs to be changed from 0.137 to 0.00137. @mairas - if this seems right to you, I'll make the change and the PR.

mairas commented 2 years ago

Yes, absolutely!

The same problem exists in the v2-dev branch as well. Would you mind fixing it there as well?

ba58smith commented 2 years ago

Fixed in master with PR #486. Fixed in v2-dev with PR #487.