remove DEBUG code
This commit is contained in:
parent
497b04ec9f
commit
ead9e06bf9
@ -3,7 +3,6 @@
|
|||||||
#include <TinyPower.h>
|
#include <TinyPower.h>
|
||||||
#include <SoftwareSerial_Tiny.h>
|
#include <SoftwareSerial_Tiny.h>
|
||||||
|
|
||||||
#define DEBUG 0
|
|
||||||
#define SEND_INTERVAL (int)(5*60/8)
|
#define SEND_INTERVAL (int)(5*60/8)
|
||||||
#define SEND_VCC_INTERVAL (int)(60*60/8)
|
#define SEND_VCC_INTERVAL (int)(60*60/8)
|
||||||
|
|
||||||
@ -12,12 +11,6 @@
|
|||||||
#define SENDER PIN_B2
|
#define SENDER PIN_B2
|
||||||
#define TEMP_PIN A2
|
#define TEMP_PIN A2
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
#define RxD PIN_B3
|
|
||||||
#define TxD PIN_B4
|
|
||||||
SoftwareSerial AttinySerial(RxD, TxD);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
int readTemp();
|
int readTemp();
|
||||||
|
|
||||||
TempSensor sensor = TempSensor(TEMP_SENSOR);
|
TempSensor sensor = TempSensor(TEMP_SENSOR);
|
||||||
@ -26,10 +19,6 @@ volatile int counter = 0;
|
|||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
|
|
||||||
#if DEBUG
|
|
||||||
AttinySerial.begin(9600);
|
|
||||||
AttinySerial.println("starting...");
|
|
||||||
#endif
|
|
||||||
analogReference(INTERNAL);
|
analogReference(INTERNAL);
|
||||||
pinMode(TEMP_POSITIVE, OUTPUT);
|
pinMode(TEMP_POSITIVE, OUTPUT);
|
||||||
digitalWrite(TEMP_POSITIVE, LOW);
|
digitalWrite(TEMP_POSITIVE, LOW);
|
||||||
@ -54,21 +43,9 @@ int readTemp() {
|
|||||||
delay(10);
|
delay(10);
|
||||||
int reading = analogRead(TEMP_PIN);
|
int reading = analogRead(TEMP_PIN);
|
||||||
digitalWrite(TEMP_POSITIVE, LOW);
|
digitalWrite(TEMP_POSITIVE, LOW);
|
||||||
#if DEBUG
|
|
||||||
AttinySerial.println(reading);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float voltage = reading * (1100 / 1024.0);
|
float voltage = reading * (1100 / 1024.0);
|
||||||
#if DEBUG
|
|
||||||
AttinySerial.print(voltage);
|
|
||||||
AttinySerial.println(" mili volts");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
float temperatureC = (voltage - 500) / 10;
|
float temperatureC = (voltage - 500) / 10;
|
||||||
#if DEBUG
|
|
||||||
AttinySerial.print(temperatureC);
|
|
||||||
AttinySerial.println(" degrees C");
|
|
||||||
#endif
|
|
||||||
return roundf(temperatureC * 10);
|
return roundf(temperatureC * 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user