Show Temperature ADC values

If "SHOW_TEMP_ADC_VALUES" is defined in Configuration_adv.h, the M105
command will present, after tradicional temperatures, the ADC value read
from temp sensors. This is great for adjusting thermistor tables with
thermocouple.

From Pronterface you can see the ADC value and compare with a
thermocouple reading.. then you just need to create your own thermistor
table.

Since this merge doesnt change the original information, it doesnt mess
with PC software parsing (tested under Pronterface and Repetier-Host).
2.0.x
Alex Borro 11 years ago
parent 7fad13a1e2
commit dd3086d3f2

@ -40,6 +40,10 @@
#define AUTOTEMP_OLDWEIGHT 0.98
#endif
//Show Temperature ADC value
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT

@ -1570,6 +1570,23 @@ void process_commands()
SERIAL_PROTOCOLPGM(" B@:");
SERIAL_PROTOCOL(getHeaterPower(-1));
#ifdef SHOW_TEMP_ADC_VALUES
#if defined(TEMP_BED_PIN) && TEMP_BED_PIN > -1
SERIAL_PROTOCOLPGM(" ADC B:");
SERIAL_PROTOCOL_F(degBed(),1);
SERIAL_PROTOCOLPGM("C->");
SERIAL_PROTOCOL_F(rawBedTemp()/OVERSAMPLENR,0);
#endif
for (int8_t cur_extruder = 0; cur_extruder < EXTRUDERS; ++cur_extruder) {
SERIAL_PROTOCOLPGM(" T");
SERIAL_PROTOCOL(cur_extruder);
SERIAL_PROTOCOLPGM(":");
SERIAL_PROTOCOL_F(degHotend(cur_extruder),1);
SERIAL_PROTOCOLPGM("C->");
SERIAL_PROTOCOL_F(rawHotendTemp(cur_extruder)/OVERSAMPLENR,0);
}
#endif
SERIAL_PROTOCOLLN("");
return;
break;

@ -35,6 +35,10 @@ void manage_heater(); //it is critical that this is called periodically.
// do not use these routines and variables outside of temperature.cpp
extern int target_temperature[EXTRUDERS];
extern float current_temperature[EXTRUDERS];
#ifdef SHOW_TEMP_ADC_VALUES
extern int current_temperature_raw[EXTRUDERS];
extern int current_temperature_bed_raw;
#endif
extern int target_temperature_bed;
extern float current_temperature_bed;
#ifdef TEMP_SENSOR_1_AS_REDUNDANT
@ -66,6 +70,16 @@ FORCE_INLINE float degHotend(uint8_t extruder) {
return current_temperature[extruder];
};
#ifdef SHOW_TEMP_ADC_VALUES
FORCE_INLINE float rawHotendTemp(uint8_t extruder) {
return current_temperature_raw[extruder];
};
FORCE_INLINE float rawBedTemp() {
return current_temperature_bed_raw;
};
#endif
FORCE_INLINE float degBed() {
return current_temperature_bed;
};

Loading…
Cancel
Save