2017-09-26 02:58 AM
Hi there,
I'm working on STM32F103 MCU and i need to compute the powerof a value.
I use the math.h library but I'm looking for a more optimised library, if it's exists.
Is there a better way to compute the power?
Best Regards,
F.
#math.h Note: this post was migrated and contained many threaded conversations, some content may be missing.2017-09-26 09:46 AM
I'm not working on a hobby project.
Fine, the initial posts just sounded like that.
Then I would think harder before pulling in floating point functions and libraries at all. You will see the impact on code space usage.
Having a look at the datasheet, I can't immediately identify an x^y relation (power function).
Rather, it seems partially ambiguous (voltage for 2.0cm distance = voltage for 5.5cm distance).
I would make my own measurement, and perhaps try a table-based approach.
2017-09-26 09:50 AM
First I started with an existing library for arduino just for have a first solution in a small amount of time.
There are different approach to this sensor: power, division, lookup table.
I'm try to find the approach that balance the accuracy and limited calculation time