Mathematical calculation

Status
Not open for further replies.

amindzo

Member
Hi, how can i calculate this formula with picbasic?

RH(linear)= -2.0468+(0.0367*SORH)-(SORH*SORH*1.5955e-6)

SORH is a 12 bit data that is given from sensor. i should put that data in above formula to calculate the humidity in %. how should i write the code?
 
I don't know if picbasic supports floating point. I can only give you a general hint.
Convert the formula to deal with integers only. Multiply both sides of equation with some integer value in order to get rid of fractional values. Once you have only integer multiplications and additions then you will probably know how to proceed. Finally, you finish with integer division.
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…