tested the read_adc with thermal_printer

This commit is contained in:
cuu 2021-05-27 13:47:34 +08:00
parent 46944be3ce
commit 9c0e674f78
2 changed files with 18 additions and 6 deletions

View File

@ -114,7 +114,7 @@
#define TempNominal 25
#define ADCResolution 1024
#define SeriesResistor 30000
#define NumSamples 10
#define NumSamples 1
#define KELVIN 1
#define CELSIUS 0

View File

@ -22,6 +22,7 @@ uint8_t as;
static unsigned int printer_vps_time;
static uint8_t printer_vps_last_status;
static uint8_t printer_temp_check;
void printer_send_data8(uint8_t w)
{
@ -62,15 +63,25 @@ uint8_t IsPaper()
else
{status = NO_PAPER; PRINTF("Error:NO PAPER\n"); }
DISABLE_PEM;
if(printer_temp_check > 20) {
tmp = temperature();
if (tmp >= HOT){
PRINTF("Printer too Hot\n");
status |= HOT_PRINTER;
}
printer_temp_check = 0;
}else {
printer_temp_check++;
}
}else {
status = printer_vps_last_status;
}
tmp = temperature();
if (tmp >= HOT){
PRINTF("Printer too Hot\n");
status |= HOT_PRINTER;
}
printer_vps_last_status = status;
printer_vps_time = millis();
@ -123,6 +134,7 @@ uint8_t header_init() {
printer_vps_time = 0;
printer_vps_last_status = IS_PAPER;
printer_temp_check= 0;
}