OneDay電子工作しよう。
なるほど、各レジスタに下の計算式が一対一で対応しているのか。
じゃ、これらのレジスタを読み出して、下の計算式を計算して表示すれば、今日のミッションは完了。
ちなみに1kPa=10hPa(ヘクトパスカル)
このセンサの出力は、0で500hPa、1023で1150hPaということになるので、一般的なお天気の気圧配置を調べることが出来るセンサだ。
The pressure compensation for MPL115A2 is based on a 2-dimensional, second order polynomial. The 10-bit compensated pressure output, Pcomp, is calculated as follows:
Pcomp = a0 + (b1 + c11*Padc + c12*Tadc) * Padc + (b2 + c22*Tadc) * Tadc
Where:
Padc is the 10-bit pressure output of the MPL115A2 ADC,
Tadc is the 10-bit temperature output of the MPL115A2 ADC,
a0 is the pressure offset coefficient,
b1 is the pressure sensitivity coefficient,
c11 is the pressure linearity (2nd order) coefficient,
c12 is the coefficient for temperature sensitivity coefficient (TCS),
b2 is the 1st order temperature offset coefficient (TCO),
c22 is the 2nd order temperature offset coefficient.
Ideally, Pcomp will produce a value of 0 with an input pressure of 50 kPa and will produce a full-scale value of 1023 with an input pressure of 115 kPa.