Skip to content

Commit 71e1e83

Browse files
committed
Add ifdef for serial prints
Removed of final code
1 parent d9e67f0 commit 71e1e83

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

proofing-box-arduino-extended.ino

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#include <LiquidCrystal.h>
22

3+
//#define SERIAL_DEBUG 1
4+
35
// initialize LCD library
46
const int rs = 11, en = 10, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
57
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
@@ -53,8 +55,10 @@ byte flameChar2[] = {
5355

5456
void setup()
5557
{
58+
#ifdef SERIAL_DEBUG
5659
// Setup debug serial
5760
Serial.begin(9600);
61+
#endif
5862

5963
// Setup I/Os
6064
pinMode(tempSensor, INPUT);
@@ -84,18 +88,24 @@ double readTermperature() {
8488
vout = analogRead(tempSensor);
8589
vout = analogRead(tempSensor);
8690

91+
#ifdef SERIAL_DEBUG
8792
Serial.print("sample:");
8893
Serial.print(vout);
8994
Serial.print(",");
95+
#endif
9096
vout = vout * 1.129 / 1023.0; // little bit tuned
97+
#ifdef SERIAL_DEBUG
9198
Serial.print("v:");
9299
Serial.print(vout);
93100
Serial.print(",");
101+
#endif
94102

95103
// Returning value in Degree Celsius
96104
vout = vout * 100;
105+
#ifdef SERIAL_DEBUG
97106
Serial.print("t:");
98107
Serial.println (curTemp);
108+
#endif
99109

100110
return vout;
101111
}
@@ -114,9 +124,11 @@ double readSetTemp() {
114124
// sadly the first read is less accurate... use the second one
115125
readT = analogRead(tempSetting);
116126
readT = analogRead(tempSetting);
127+
#ifdef SERIAL_DEBUG
117128
Serial.print("readT:");
118129
Serial.print(readT);
119130
Serial.print(",");
131+
#endif
120132
return readT * 40 / 1023; // set a max of 40C
121133
}
122134

0 commit comments

Comments
 (0)