diff --git a/Code/thermal_printer/Makefile b/Code/thermal_printer/Makefile index e9365ae..4231fc2 100644 --- a/Code/thermal_printer/Makefile +++ b/Code/thermal_printer/Makefile @@ -3,7 +3,7 @@ CC = gcc CFLAGS = -g -Wall LDFLAUS = INCLUDES = -LIBS = -lwiringPi +LIBS = -lwiringPi -lm MAIN = devterm_thermal_printer.elf diff --git a/Code/thermal_printer/printer.c b/Code/thermal_printer/printer.c index 8291a33..c56cd04 100644 --- a/Code/thermal_printer/printer.c +++ b/Code/thermal_printer/printer.c @@ -2,6 +2,7 @@ #include #include #include +#include #include #include @@ -101,7 +102,7 @@ uint8_t header_init() { //adc.setChannels(pin, 1); //this is actually the pin you want to measure - //pinMode(THERMISTORPIN,INPUT_ANALOG); // 数字io没有 模拟接口。adc 读温度暂时不搞 + pinMode(THERMISTORPIN,INPUT); // 数字io没有 模拟接口。adc 读温度暂时不搞 /* //SPI.begin(); //Initialize the SPI_1 port. @@ -334,9 +335,9 @@ void print_dots_8bit(CONFIG*cfg,uint8_t *Array, uint8_t characters,uint8_t feed_ uint16_t temperature() { - /* + double Rthermistor = 0, TempThermistor = 0; - uint16 ADCSamples=0; + uint16_t ADCSamples=0; int Sample = 1; uint16_t ADCConvertedValue; @@ -358,9 +359,9 @@ uint16_t temperature() { TempThermistor = 1/TempThermistor; return (uint16_t)(TempThermistor - 273.15); - */ - return (uint16_t)(0); + + //return (uint16_t)(0); }