315MHz RF Tx-Rx Modules

Hi, i've bought those 315 Mhz wireless modules : link

i tried to configure them and use as the following guide :

link

that is using pin 12 for data in the transmitter and pin 11 for data in the receiver,

for the code i used the RadioHead librari with the object RH_ASK as follow:

for the transmitter:

// Include RadioHead Amplitude Shift Keying Library
#include <RH_ASK.h>
// Include dependant SPI Library
#include <SPI.h>

// Create Amplitude Shift Keying Object
RH_ASK rf_driver;

void setup()
{
// Initialize ASK Object
rf_driver.init();
}

void loop()
{
const char *msg = "Hello World";
rf_driver.send((uint8_t *)msg, strlen(msg));
rf_driver.waitPacketSent();
delay(1000);
}

for the receiver:

// Include RadioHead Amplitude Shift Keying Library
#include <RH_ASK.h>
// Include dependant SPI Library
#include <SPI.h>

// Create Amplitude Shift Keying Object
RH_ASK rf_driver;

void setup()
{
// Initialize ASK Object
rf_driver.init();
// Setup Serial Monitor
Serial.begin(9600);
}

void loop()
{
// Set buffer to size of expected message
uint8_t buf[11];
uint8_t buflen = sizeof(buf);
// Check if received packet is correct size
if (rf_driver.recv(buf, &buflen))
{

// Message received with valid checksum
Serial.print("Message Received: ");
Serial.println((char*)buf);
}
}

but i don't see anything in the serial monitor, what can be the problem? Thanks

Read "How To Use This Forum"

in particular, 7. If you are posting code or error messages, use "code" tags

This is what happens when you do not

if you have a module that is not working, do not say "A GPS" or "the fingerprint sensor". Show us a link to the particular sensor, and a link to the datasheet if available

Do you have antennas attached to the rf modules? I've found that without any antenna I could only get a reliable connection with the transmitter and receiver about an inch apart. With an antenna on the receiver I can get good signal at least 20 feet away.

jmsurpri:
Do you have antennas attached to the rf modules? I've found that without any antenna I could only get a reliable connection with the transmitter and receiver about an inch apart. With an antenna on the receiver I can get good signal at least 20 feet away.

I tried to put them very close but still the problem remain