Skip to content

Commit ecf4eb8

Browse files
committed
Fix multiple relay switching error on power up
Applied fix for multiple relays turning on when power is first turned on. Reported and fixed here: https://forum.mysensors.org/topic/153/irrigation-controller-up-to-16-valves-with-shift-registers/247
1 parent e8de4c0 commit ecf4eb8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

examples/IrrigationController/IrrigationController.ino

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ Available from the MySensors store - http://www.mysensors.org/store/
4848
* FTDI USB to TTL Serial Adapter
4949
* Capacitors (10uf and .1uf)
5050
* 3.3v voltage regulator
51-
* Resistors (270 & 10K)
51+
* Resistors (270, 1K & 10K)
5252
* Female Dupont Cables
5353
* 1602 LCD (with I2C Interface)
5454
* LED
@@ -162,6 +162,7 @@ time_t lastTimeRun = 0;
162162
const int latchPin = 8;
163163
const int clockPin = 4;
164164
const int dataPin = 7;
165+
const int outputEnablePin = 6;
165166
//
166167
byte clock[8] = {0x0, 0xe, 0x15, 0x17, 0x11, 0xe, 0x0}; // fetching time indicator
167168
byte raindrop[8] = {0x4, 0x4, 0xA, 0xA, 0x11, 0xE, 0x0,}; // fetching Valve Data indicator
@@ -182,6 +183,8 @@ void setup()
182183
pinMode(clockPin, OUTPUT);
183184
pinMode(dataPin, OUTPUT);
184185
pinMode(ledPin, OUTPUT);
186+
pinMode(outputEnablePin, OUTPUT);
187+
digitalWrite (outputEnablePin, LOW);
185188
pinMode(waterButtonPin, INPUT_PULLUP);
186189
//pinMode(waterButtonPin, INPUT);
187190
attachInterrupt(digitalPinToInterrupt(waterButtonPin), PushButton, RISING); //May need to change for your Arduino model

0 commit comments

Comments
 (0)