application: add tube temperature
This commit is contained in:
parent
9fbd4d377e
commit
b531e4cde3
|
@ -389,18 +389,16 @@ static float bed_bothalf_temperature(void)
|
||||||
/** read bed tube temperature
|
/** read bed tube temperature
|
||||||
* @return temperature in °C
|
* @return temperature in °C
|
||||||
*/
|
*/
|
||||||
/*
|
|
||||||
static float bed_tube_temperature(void)
|
static float bed_tube_temperature(void)
|
||||||
{
|
{
|
||||||
const uint16_t measurement = sensor_max1247_read(3); // read measured value from corresponding thermistor
|
const uint16_t measurement = sensor_max1247_read(3); // read measured value from corresponding thermistor
|
||||||
|
|
||||||
// convert to °C
|
// convert to °C
|
||||||
// calibrated using a DS18B20 (accuracy = +- 0.5°C), with 12-bit precision
|
// calibrated using a TP101 with 0.1 °C precision (unknown accuracy but is on par with DS18B20)
|
||||||
// 19.312 °C = 564
|
// 557 = 19.5 °C, 3221 = 100.9 °C
|
||||||
|
|
||||||
return measurement * 0.0270798 + 4.38946;
|
return measurement * 0.0305556 + 2.48056;
|
||||||
}
|
}
|
||||||
*/
|
|
||||||
|
|
||||||
/** read heat sink temperature
|
/** read heat sink temperature
|
||||||
* @return temperature in °C
|
* @return temperature in °C
|
||||||
|
@ -1209,8 +1207,9 @@ void main(void)
|
||||||
const float heatsink_temp = bed_heatsink_temperature();
|
const float heatsink_temp = bed_heatsink_temperature();
|
||||||
const float top_temp = bed_tophalf_temperature();
|
const float top_temp = bed_tophalf_temperature();
|
||||||
const float bot_temp = bed_bothalf_temperature();
|
const float bot_temp = bed_bothalf_temperature();
|
||||||
|
const float tube_temp = bed_tube_temperature();
|
||||||
// read bed temperatures
|
// read bed temperatures
|
||||||
printf("bed: top=%u %.2f, bottom=%u %.02f, sink=%u %.02f, tube=%u; 393-A=%u; 339-3=%u\n",sensor_max1247_read(0), top_temp, sensor_max1247_read(1), bot_temp, sensor_max1247_read(2), heatsink_temp, sensor_max1247_read(3), gpio_get(GPIO_PORT(BED_PIN_393A), GPIO_PIN(BED_PIN_393A)) ? 1 : 0, gpio_get(GPIO_PORT(BED_PIN_3393), GPIO_PIN(BED_PIN_3393)) ? 1 : 0);
|
printf("bed: top=%u %.2f, bottom=%u %.02f, sink=%u %.02f, tube=%u %.02f; 393-A=%u; 339-3=%u\n",sensor_max1247_read(0), top_temp, sensor_max1247_read(1), bot_temp, sensor_max1247_read(2), heatsink_temp, sensor_max1247_read(3), tube_temp, gpio_get(GPIO_PORT(BED_PIN_393A), GPIO_PIN(BED_PIN_393A)) ? 1 : 0, gpio_get(GPIO_PORT(BED_PIN_3393), GPIO_PIN(BED_PIN_3393)) ? 1 : 0);
|
||||||
printf("lid: %.04f °C\n", lid_temp);
|
printf("lid: %.04f °C\n", lid_temp);
|
||||||
if (ds18b20_present) {
|
if (ds18b20_present) {
|
||||||
const float temp = sensor_ds18b20_temperature(0); // get temperature
|
const float temp = sensor_ds18b20_temperature(0); // get temperature
|
||||||
|
|
Loading…
Reference in New Issue