Help in Pressure transducer coding...

vareun:
I could not understand the code below even after referring to the transfer function.
/* get the pressure /
1 val = analogRead(pressurePin);
2 pkPa = ((float)val/(float)1023+0.095)/0.009;
3 pAtm = kpa2atm
pkPa;

line 1: reads the value the sensor returns 0..5V mapped upon a value of 0..1023
line 2: converts this value of 0..1023 to a KiloPascal - a unit of pressure
line 3: converts the KiloPascals to atmosphree by multiplying with a constant.

What part do you not understand.?

and also is it possible for me to use the MPX4250 Sensor in the same code.
if not what are the differences should be made???
http://www.farnell.com/datasheets/9703.pdf

If the sensor has the same pressure to voltage transfer function => yes
else => no

2 answers in the gigs forum, please donate $2 to charity of choice :wink: