Reading rf signals

I have two unos and two rf receivers and transmitters and want to use buttons on one uno to turn on and off two leds on the other... I have made the transmitter part but how can I make the receiving uno read the message received and do something according to that?

We know what you mean by an Uno.

What do you mean by RF receiver and transmitter? Post links to their datasheets.

And post the programs you have tried for the receiver and transmitter.


i am sure something is wrong

[code]#include <RH_ASK.h>
#include <SPI.h> // Not actualy used but needed to compile
int led1 = 7;
int led2 = 8;
RH_ASK driver;

void setup()
    Serial.begin(9600); // Debugging only
    if (!driver.init())
         Serial.println("init failed");

void loop()
    uint8_t buf[12];
    uint8_t buflen = sizeof(buf);
    if (driver.recv(buf, &buflen)) // Non-blocking
      int i;
      // Message with a good checksum received, dum         

    int command = buf;

    if (buf == "led1") {
      digitalWrite(led1, 1);
      digitalWrite(led2, 0);

    if (buf == "led1") {
          digitalWrite(led1, 0);
          digitalWrite(led2, 1);



i am sure something is wrong

You would be partially correct. There are MANY things wrong.

You can't assign an array to an integer. You can't compare an int to a string. You can't compare strings using ==.

It is dumb to pass "led1" or "led1" (probably should have been "led2") between the devices, when 1 or 2 conveys just as much information, while being far easier to parse.

Ok thanks for now...