-
Okay, so that confirms you have a good handle on the power supply side of things.
Had to re-visit physics for the metric pressure conversions,
https://www.enotes.com/homework-help/sea-level-what-approximate-value-atmospheric-125807
'At sea level, the approximate value of atmospheric pressure in those units of measure is as follows: 101.3 kPa which is how it is usually expressed. In pascals, it is 101325 pascals'So, making the assumption the Arduino data is accurate, and that your location is roughly 300 ft above sea level, that pressure value appears correct, which agrees with your initial Arduino understanding.
Am I to understand then, that only accurate data is obtained when L14-L17 are commented out? e.g. the console.log() statements may throw in a timing issue with the data response and I2C comm? @allObjects mentioned busy state in #4 post. Is accurate data obtained for each of the other readings when done one at a time?
See p.10 and section 5.3
https://cdn.sparkfun.com/datasheets/Sensors/Pressure/MPL3115A2.pdf
That might be it, as the time to update the WebIDE most likely is taking longer than how Arduino would handle that task, even with the 10msec delay at each register read.
https://github.com/adafruit/Adafruit_MPL3115A2_Library/blob/master/Adafruit_MPL3115A2.cpp
I am using a MDBT42Q breakout. It is on a breadboard. The MDBT42Q and the MPL3115A2 are powered with 5v. The screen does work. I was getting the same readings when it wasn't in the mix. The MPL3115A2 is from Adafruit.
I have refactored my code to this (with the same result):
Per @allObjects I changed it so that I was only reading pressure. When I do that, the readings are 100066, and that is really close to the Arduino.