OilSlick / kencana_air_sensor

An air sensor for inside a home.
http://blog.michaelcwright.com/2020/07/14/air-quality-sensor/
1 stars 0 forks source link

With addition of Struct, propane values somehow unusually low #4

Closed OilSlick closed 4 years ago

OilSlick commented 4 years ago
Date Time Value
2020/05/24 4:37:06pm 5.544573
2020/05/24 4:32:06pm 5.122562
2020/05/24 4:24:40pm 3087.000000
2020/05/24 4:18:01pm 3087.000000
OilSlick commented 4 years ago

It appears that with the addition of the sanity check isValid() the propane value changes. I'm not sure why. Getting all gas values rapidly, like below gives values as before:

gasNH3.value = gas.measure_NH3();<BR> gasCO.value = gas.measure_CO(); gasNO2.value = gas.measure_NO2(); gasC3H8.value = gas.measure_C3H8(); gasC4H10.value = gas.measure_C4H10(); gasCH4.value = gas.measure_CH4(); gasH2.value = gas.measure_H2(); gasC2H5OH.value = gas.measure_C2H5OH(); return;

Probably need to separate out into more functions:

getData()

encodeData()

transmitData()

OilSlick commented 4 years ago

Grouping all gas.measure_XXX() together did the trick. Separated all three functions as mentioned.