So, basically we work on an ethyl alcohol tester and we need to use the Ln function and the exponential function.
However Flowcode doesn't compile the program when we use these functions in our calcul instruction, so we decided to make a test program (see the attachments).
But the flowcode return code is still equal to 1, same for the exponantial one while the pow function work properly. If anyone have any idea to help us, it'll be pretty cool.
Regards,
Chloe.
Edit :
Solution :
The problem is that 8-bit PIC uses the BoostC compiler which does not support the Exp and Ln functions, so you have to create your own macros in order to approache these functions.
There is a sample (from SteveM) which contains these functions in order to use them with 8-bit PIC :
SteveM wrote:The float_exp() macro is simple - it is just the pow() function, but with the 'E' value (Euler's number) preset as the number base. The float_ln() macro is a bit more complex - it uses a Taylor Polynomial approximation - so the accuracy and speed may not be quite as good as a proper compiled 'C' version. You can adjust the accuracy (at the cost of some speed), by changing the value of the 'PRECISION' constant in the float_ln() macro - but it is good to three or four decimal places, which should be precise enough for most high school science experiments.
I don't have an ECIO40 to hand, but FC6 compiled the macro's to an ECIO40 .hex file without errors, so hopefully this will help to get your project working.