The photon reads temperature and humidity using a DHT11 sensor.
I measure a sensor 5 times and publish the mean (+100 for debugging) of the readings using Particle.publish().
I would then expect that if the computations or the sensor readings would be zero, then the published value would be 100, but instead I see that the published value is 0;
Put the measured values in the array and then make the elimination of the minimum value of the series. Then the resulting new array divide it by the number of members of the array.
The mean of non-negative values are only zero iff all values are zero thus it can not be the computation of mean. Also I have added 100 after computing mean. This is neither visible in the published data.
The event is propagated to a backend using hooks. The backend also produces the graphs. The problem seems to occur before reaching the hook, as I see 0 values in the web particle console.
Most likely problem is a library for reading the sensor.
See through a serial connection if the problem is the reading of the sensor.
The problem initiates a problem with the initialization of the array, if anywhere using memset or using a timer. We need to see the code.
I don’t think this has anything to do with your problem, but your mean function has a problem. The sizeof function within that function will give you the size of the pointer to the array, which will be 4. You need to pass in the array count to that function to have it behave as you expect.