how to solve a linear equation with arduino

hello,

I would like to know if a function exist to solve a linear equation such as y=ax+b

I know the 'y' value and i would like to know how can i recuperate automatically 'x'?

Thanks in advance for your answer!

Franck

So I assume you know a and b as well? Simply do the math yourself and let the Arduino do the calculation

x = (y - b) / a

Fka022-FA:
hello,

I would like to know if a function exist to solve a linear equation such as y=ax+b

I know the 'y' value and i would like to know how can i recuperate automatically 'x'?

Thanks in advance for your answer!

Franck

Simple algebra matey.

Just re-arrange the equation for x and implement this in c.

y = ax + b

y - b = ax

x = (y - b) / a

ok
i'm gonna test that!
thanks a lot!

Are your variables/constants integers or floats? Any idea about the range of the values?