RemoteXY

Hi

Does anyone know if I can control 2 relays off the same button with RemoteXY. My problem is I want to control 2 relays through 1 button example below but not sure if it is possible?.

if (RemoteXY.button_1 != 1) digitalWrite(RELAY1, LOW);digitalWrite(RELAY2, HIGH);digitalWrite(RELAY3, LOW);digitalWrite(RELAY4, HIGH);

else digitalWrite(RELAY1, HIGH);digitalWrite(RELAY2, HIGH);digitalWrite(RELAY3, HIGH);digitalWrite(RELAY4, HIGH);

Thanks
Andy

Does anyone know if I can control 2 relays off the same button with RemoteXY.

What is RemoteXY? I can't imagine that it controls ANY relays.

What it more likely does is control pins on the Arduino, to which you can connect one or more relays.

If you determine that come condition is true, then you can do more than one thing in response, but NOT the way you have shown.

if (RemoteXY.button_1 != 1)
{
   digitalWrite(RELAY1, LOW);
   digitalWrite(RELAY2, HIGH);
   digitalWrite(RELAY3, LOW);
   digitalWrite(RELAY4, HIGH);
}
else
{
   digitalWrite(RELAY1, HIGH);
   digitalWrite(RELAY2, HIGH);
   digitalWrite(RELAY3, HIGH);
   digitalWrite(RELAY4, HIGH);
}

There is a long Thread about RemoteXY which may have your answer.

...R

Hi Robin

I managed to get this sorted thank you, on another front do you know if it is possible to read from a serial in a void loop and still use another piece of equipment i.e Blutooth adaptor at the same time?.

Many Thanks
Andy

do you know if it is possible to read from a serial in a void loop and still use another piece of equipment i.e Blutooth adaptor at the same time?.

There are no voids in your program. There are FUNCTIONS. Some of the functions have a return type of void. But, that does not make them voids any more than a function with a return type of int is an int.

It IS possible to read serial data in loop(), from the serial port or from some other serial device connected to other pins.

andyturner:
do you know if it is possible to read from a serial in a void loop and still use another piece of equipment i.e Blutooth adaptor at the same time?.

Yes. Have a look at the examples in Serial Input Basics - simple reliable ways to receive data.

It is almost certainly better to use SoftwareSerial to create a separate serial port for the Bluetooth adapter if you are using an Uno or Nano.

...R