substract 32 from uint8 temperature_sensor_read()
Posted: Sat Dec 26, 2015 3:14 pm
hi
think there is a little bug in read function.
we must subtract 32 from reading result to get a valid temperature.
think there is a mistake in base formula in read function.
right working code, this code
adjusted by own subtract 32 from the bug [***]
can u please check, this is my final version
posted in SDK http://esp32.com/viewtopic.php?f=13&p=321#p321
best wishes
rudi
think there is a little bug in read function.
we must subtract 32 from reading result to get a valid temperature.
think there is a mistake in base formula in read function.
right working code, this code
adjusted by own subtract 32 from the bug [***]
Code: Select all
// simple code for the measurement of OnBoard sensor
// rudi 26 Dez 2015
// base is RTOS SDK 1.1.0
// ESP31B (1. Revision "false silkscreen")
uint8 temper; // result in fahrenheit
float celsius; // conversion in Celsius later
uint8 bugCorrection = 32 ; // bug correction value [***]
// which can differ locally, fine tuning is always made
// by each itself, for me it was 0.6 degrees Celsius,
// that are 1,08 Fahrenheit , i round down to 1 here:
uint8 calibrateCorrection = 1 ; // calibrate with an mercury thermometer
// read now from SoC
temper= temperature_sensor_read();
// [***]
// bugCorrecture - 32
temper= temper - bugCorrection;
// calibrate with an mercury thermometer - 1 Fahrenheit
temper= temper - calibrateCorrection;
// conversion fahrenheit in celsius
celsius = ( temper - 32 ) / 1.8;
// output fahrenheit and celsius result
printf("Sensor onBoard is F: %i C: %.2f\n", temper, clesius);
can u please check, this is my final version
posted in SDK http://esp32.com/viewtopic.php?f=13&p=321#p321
best wishes
rudi