refactor
This commit is contained in:
parent
8a7db7450e
commit
20cc225d08
@ -13,8 +13,13 @@
|
|||||||
#define DIO 7
|
#define DIO 7
|
||||||
|
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
|
#define DEBUG_MSG(x) Serial.println(x)
|
||||||
|
#else
|
||||||
|
#define DEBUG_MSG(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
// ====Consts====
|
// ====Consts====
|
||||||
#define DEBUG 0
|
|
||||||
#define MIN_PRESSURE 60
|
#define MIN_PRESSURE 60
|
||||||
#define MAX_PRESSURE 800
|
#define MAX_PRESSURE 800
|
||||||
|
|
||||||
@ -60,17 +65,17 @@ int midArifm2(int newVal) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void setup() {
|
void setup() {
|
||||||
if (DEBUG) {
|
#if DEBUG
|
||||||
Serial.begin(9600);
|
Serial.begin(9600);
|
||||||
Serial.print("pressure");
|
#endif
|
||||||
Serial.print(',');
|
|
||||||
Serial.print("low");
|
|
||||||
Serial.print(',');
|
|
||||||
Serial.print("high");
|
|
||||||
Serial.print(',');
|
|
||||||
Serial.println("status");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
DEBUG_MSG("pressure");
|
||||||
|
DEBUG_MSG(',');
|
||||||
|
DEBUG_MSG("low");
|
||||||
|
DEBUG_MSG(',');
|
||||||
|
DEBUG_MSG("high");
|
||||||
|
DEBUG_MSG(',');
|
||||||
|
DEBUG_MSG("status");
|
||||||
|
|
||||||
pinMode(relay_port, OUTPUT);
|
pinMode(relay_port, OUTPUT);
|
||||||
|
|
||||||
@ -85,9 +90,6 @@ void setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
enc.tick();
|
enc.tick();
|
||||||
if (enc.isTurn()) {
|
if (enc.isTurn()) {
|
||||||
disp.clear();
|
disp.clear();
|
||||||
@ -174,13 +176,11 @@ void loop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (DEBUG) {
|
DEBUG_MSG(pressure);
|
||||||
Serial.print(pressure);
|
DEBUG_MSG(',');
|
||||||
Serial.print(',');
|
DEBUG_MSG(pressure_low);
|
||||||
Serial.print(pressure_low);
|
DEBUG_MSG(',');
|
||||||
Serial.print(',');
|
DEBUG_MSG(pressure_high);
|
||||||
Serial.print(pressure_high);
|
DEBUG_MSG(',');
|
||||||
Serial.print(',');
|
DEBUG_MSG(is_on_pump*100);
|
||||||
Serial.println(is_on_pump*100);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user