remove DEBUG code

This commit is contained in:
Nicu Hodos 2021-12-31 16:04:48 +01:00
parent 497b04ec9f
commit ead9e06bf9

View File

@ -3,7 +3,6 @@
#include <TinyPower.h>
#include <SoftwareSerial_Tiny.h>
#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);
}