RF remote transmitting binary

Hi I have some remote power sockets that I want to control with and Arduino, I've used the RCswitch library to capture the signal and made an TX unit to turn on which is working.

This is the code

#include <RCSwitch.h>
RCSwitch mySwitch = RCSwitch();
int Button_in = 4;

void setup() {
  Serial.begin(9600);
  pinMode(Button_in, INPUT_PULLUP);
  // Transmitter is connected to Arduino Pin #10
  mySwitch.enableTransmit(2);
  // Optional set pulse length.
  mySwitch.setPulseLength(420);
  // Optional set protocol (default is 1, will work for most outlets)
  mySwitch.setProtocol(1);

  // Optional set number of transmission repetitions.
  // mySwitch.setRepeatTransmit(15);
}

void loop() {
  if (digitalRead(Button_in) == LOW ) { //&& ldrreading < ldrbreakpoint){
    mySwitch.send("010001010100010101010101");
  }

}

The bit I'm having trouble with is how to understand how to send this

"010001010100010101010101"

So the RX unit will understand it
I thought something like this would work

int16_t TX_1 = 010001010100010101010101

Then send it out like this but it does not work

mySwitch.send("TX_1");

Also tried it like this but it still does not work

mySwitch.send(TX_1);

I've tried to search but not sure what to search for, I would like to do it like this so I can just send the data to a function type of thing without having to keep wrting it in code

"010001010100010101010101" is a binary value of 24 bits. The assignment "int16_t TX_1 = 010001010100010101010101" is bogus since a 16 bit value cannot hold such a large number and because you are assigning the decimal value "010001010100010101010101" to it. This is probably what you need "uint_32t TX_1 = 0b010001010100010101010101" - 0b is the prefix for binary values in GCC.

unsigned long TX_1 = 0b010001010100010101010101;
mySwicth.send(TX_1, 24); // Send 24 bits from TX_1

Thanks Danois90
That works a treat

Steve

The assignment "int16_t TX_1 = 010001010100010101010101" is bogus since a 16 bit value cannot hold such a large number and because you are assigning the decimal value "010001010100010101010101"

Actually that is written in octal not decimal. The leading 0 tells it to be interpreted as octal.