trending formula syntex [solved]

im using a sharp range finder, a long range one (150-550cm, gp2y0a710k0f)
i used excel to generate a strong fitting formula and would like to implement it in arduino

> i post as image as im not clear how to write it.

similar question from old board, but not clear how he got there.

any help welcomed.

as im not interested in exact distance, just linearity.
f = x^ - 1.192
is good enough ?

is that what u look for:

e. g.:


using POW was covered in previous question link
im looking to understand rest of formula
i did implment the pow as you showed. looks linear enough

does this help:


i dont fully understand ur problem...
do u want to know, how excel makes that formula?

i basically want to write the full formula
but how do i write the first part of formula in arduino syntex > "6E+07"

sorry for delay i dont get notifications on this post.

oh - ok... it's easy...

it should be like this:

float y = 6e7*pow(x,-1.192)

6e7 = 6.00E+7 = 6.00pow(10,7) = 6.01010001000

thanks, done and solved

yahoo! :slight_smile:
wag tail

have fun