Needing better averaging code for pressure sensor

Manufacturer page of the MXP5100: Integrated Pressure Sensor (0 to 100 kPa) | NXP Semiconductors.

Datasheet MXP5100DP: https://www.nxp.com/docs/en/data-sheet/MPX5100.pdf.
In the datasheet a 470 pF is mentioned to reduce the noise of the output signal.

In that datasheet, the AN1646 application note is mentioned: https://www.nxp.com/docs/en/application-note/AN1646.pdf.

AN1646 is about noise considerations with these sensors.
It is only about the noise that the sensor creates itself and electronic noise from the circuit or power supply. It is not about reducing the noise from changes in the measured pressure.

The recommendation is a RC filter with 750 Ω and 0.33 µF. There is also a section about the power supply and they recommend a linear regulator like the 7805.

The Arduino Nano has a diode when power via USB, that will change the VCC and therefor the RC filter is not a good idea.

KevinRoach, the pressure sensor measures the pressure. If the pressure changes, and the sensor measures that, then the sensor is working well. The datasheet and application note do not mention a situation when the pressure changes. The application note also assumes that the 5V is good and is a steady 5.0 V, but the Arduino Nano does not have a steady 5.0 V. The 470 pF mentioned in the datasheet can be used and will reduce noise from the sensor. However, since you need a filter in software anyway, the 470 pF is not needed.