TX
(#include <RH_ASK.h>
#include <SPI.h>

RH_ASK driver;

void setup() {
  Serial.begin(9600);
  if (!driver.init()) {
    Serial.println("Init failed");
  }
}

void loop() {
  const char *msg = "Hello!";
  driver.send((uint8_t *)msg, strlen(msg));
  driver.waitPacketSent();
  Serial.println("Sent message");
  delay(1000);
}
)



Rx
(#include <RH_ASK.h>
#include <SPI.h>

RH_ASK driver;

void setup() {
  Serial.begin(9600);
  if (!driver.init()) {
    Serial.println("Init failed");
  }
}

void loop() {
  uint8_t buf[50];
  uint8_t buflen = sizeof(buf);

  if (driver.recv(buf, &buflen)) {
    buf[buflen] = 0;
    Serial.print("Received: ");
    Serial.println((                                                                      char*)buf);
  }
}
)