We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c5d1d17 commit 1eeac79Copy full SHA for 1eeac79
examples/PID_RelayOutput/PID_RelayOutput.ino
@@ -18,6 +18,8 @@
18
19
#define PIN_INPUT 0
20
#define RELAY_PIN 6
21
+#define RELAY_ON LOW
22
+#define RELAY_OFF HIGH
23
24
//Define Variables we'll be connecting to
25
double Setpoint, Input, Output;
@@ -55,8 +57,14 @@ void loop()
55
57
{ //time to shift the Relay Window
56
58
windowStartTime += WindowSize;
59
}
- if (Output < millis() - windowStartTime) digitalWrite(RELAY_PIN, HIGH);
- else digitalWrite(RELAY_PIN, LOW);
60
+ if (Output > millis() - windowStartTime)
61
+ {
62
+ digitalWrite(RELAY_PIN, RELAY_ON);
63
+ }
64
+ else
65
66
+ digitalWrite(RELAY_PIN, RELAY_OFF);
67
68
69
70
0 commit comments