I am not a programmer, so struggling a bit trying to figure out how to accomplish the following with a function node. I'm sure it's pretty simple stuff for a pro
I'm trying to consolidate/simplify a code by turning on/off a relay via serial, but controlled by a switch node (on/off) in Node-red. I can get what I want to happen with the following:
But want to be able to control the on/off for the multiple output pins defined all in one function. Any help is much appreciated!
I'm assuming I would need some kind of switch node to pass the appropriate relay number and on/off command but not sure how to implement.