From ead9e06bf990bd7d6eb64e7f3557ecb23b71340d Mon Sep 17 00:00:00 2001 From: Nicu Hodos Date: Fri, 31 Dec 2021 16:04:48 +0100 Subject: [PATCH] remove DEBUG code --- temp_sensor/src/temp_sensor.cpp | 23 ----------------------- 1 file changed, 23 deletions(-) diff --git a/temp_sensor/src/temp_sensor.cpp b/temp_sensor/src/temp_sensor.cpp index 949f901..c73de4c 100644 --- a/temp_sensor/src/temp_sensor.cpp +++ b/temp_sensor/src/temp_sensor.cpp @@ -3,7 +3,6 @@ #include #include -#define DEBUG 0 #define SEND_INTERVAL (int)(5*60/8) #define SEND_VCC_INTERVAL (int)(60*60/8) @@ -12,12 +11,6 @@ #define SENDER PIN_B2 #define TEMP_PIN A2 -#if DEBUG -#define RxD PIN_B3 -#define TxD PIN_B4 -SoftwareSerial AttinySerial(RxD, TxD); -#endif - int readTemp(); TempSensor sensor = TempSensor(TEMP_SENSOR); @@ -26,10 +19,6 @@ volatile int counter = 0; void setup() { -#if DEBUG - AttinySerial.begin(9600); - AttinySerial.println("starting..."); -#endif analogReference(INTERNAL); pinMode(TEMP_POSITIVE, OUTPUT); digitalWrite(TEMP_POSITIVE, LOW); @@ -54,21 +43,9 @@ int readTemp() { delay(10); int reading = analogRead(TEMP_PIN); digitalWrite(TEMP_POSITIVE, LOW); -#if DEBUG - AttinySerial.println(reading); -#endif float voltage = reading * (1100 / 1024.0); -#if DEBUG - AttinySerial.print(voltage); - AttinySerial.println(" mili volts"); -#endif - float temperatureC = (voltage - 500) / 10; -#if DEBUG - AttinySerial.print(temperatureC); - AttinySerial.println(" degrees C"); -#endif return roundf(temperatureC * 10); }