denis-nabatchikov/bme280
node { void evaluate(Context ctx) { int32_t adc_T = getValue<input_adc_T>(ctx); uint16_t dig_T1 = getValue<input_dT1>(ctx); int16_t dig_T2 = getValue<input_dT2>(ctx); int16_t dig_T3 = getValue<input_dT3>(ctx); int32_t var1, var2; int64_t t_fine; var1 = ((((adc_T >> 3) - ((int32_t)dig_T1 << 1))) * ((int32_t)dig_T2)) >> 11; var2 = (((((adc_T >> 4) - ((int32_t)dig_T1)) * ((adc_T >> 4) - ((int32_t)dig_T1))) >> 12) * ((int32_t)dig_T3)) >> 14; t_fine = var1 + var2; float T = ((t_fine * 5 + 128) >> 8) / 100.0; emitValue<output_t_FINE>(ctx, t_fine); emitValue<output_TEMP>(ctx, T); emitValue<output_DONE>(ctx, true); } }
© 2017–2024XOD Inc
Contact us: hello@xod.io