Go Down

Topic: Mpx4115 pressure sensor solution (Read 938 times) previous topic - next topic

grendle

Jan 02, 2013, 04:57 pm Last Edit: Jan 22, 2013, 04:03 pm by grendle Reason: 1
hi. sensor works great just thought i'd share.

the math to convert to kPa and psi.

a=analogRead(1);

b = ((a * .0049 / 5) + .095) / .009;//conversion to kilopascal kpa  << this is all i wanted to show



regular around sealevel pressure is around 101.xx kpa and 14.xx psi.

AWOL

"a" and "b" (not good variable names, IMO) have global scope.
Why?

Please used code tags when posting code.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

grendle

relax, just lil snippet to test/get sensor working. just trying to help someone since there is very little information on this sensor that I can find.

AWOL

It isn't clear to me why you display the kPa and PSI values twice.
Please go back to you post and put the code inside code tags.
Use the "modify" control.
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

grendle

that was my own testing code, thats probably why it didnt make sense. the only line needed is the conversion so i left that and took everything else out to stop confusion. my fault.

Go Up