Newbie, adding more than one relay to nodemanager
-
I just started using nodemanager. GREAT WORK! Might be a dumb question but how do i add more than one relay to the sketch? I would like to control 4 but only can get one to work. Thanks in advance!
-
Hi @mghaff, just add additional instances of the relay and you can configure them individually. E.g.
#include <sensors/SensorRelay.h> SensorRelay relay1(4); SensorRelay relay2(5); SensorRelay relay3(6);
-
This post is deleted!
-
@user2684 Perfect Thanks!
-
@user2684 Another Question.... Thanks in advance!
Where do i put this to get my relay to invert operation?
// [109] Invert the value to write. E.g. if ON is received, write LOW (default: false)
void setInvertValueToWrite(bool value);And how should it be written.
I tried this.
#include <sensors/SensorRelay.h>
SensorRelay relay1(8);
SensorRelay relay2(5);
SensorRelay relay3(6);
SensorRelay relay4(7);
// [109] Invert the value to write. E.g. if ON is received, write LOW (default: false)
SensorRelay setInvertValueToWrite(true);
-
@mghaff inside before() you have to call the function setInvertValueToWrite() on the relay you want to apply it to. E.g.
relay1.setInvertValueToWrite(true); relay2.setInvertValueToWrite(true); .....
-
@user2684 said in Newbie, adding more than one relay to nodemanager:
relay1.setInvertValueToWrite(true);
relay2.setInvertValueToWrite(true);WOW Thanks Again! This is really fun and easy to work with! Thank you!!!!