Hi, I have an uno and a nano that I'm using as a test bed for RF transmitting\ receiving using virtualwire. I have 3 sets of the cheap 433 mhz RF pairs from ebay (for testing). Currently, I can't get it to receive anything. Setup is attached. Thanks in advance for help, and sorry in advance if this is something simple and stupid
here is the code on the uno (transmitter)
#include <VirtualWire.h>
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600); // Debugging only
Serial.println("setup");
vw_set_tx_pin(12);
vw_setup(2000); // Bits per sec
}
void loop()
{
const char *msg = "hello";
digitalWrite(10, true); // Flash a light to show transmitting
vw_send((uint8_t *)msg, strlen(msg));
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(10, false);
delay(200);
}
and the code for the nano (receiver)
#include <VirtualWire.h>
void setup()
{
pinMode(13, OUTPUT);
Serial.begin(9600); // Debugging only
Serial.println("setup");
// Initialise the IO and ISR
vw_set_rx_pin(12);
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver PLL running
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // Non-blocking
{
int i;
digitalWrite(13, true); // Flash a light to show received good message
// Message with a good checksum received, dump it.
Serial.print("Got: ");
for (i = 0; i < buflen; i++)
{
Serial.print(buf[i], HEX);
Serial.print(" ");
}
Serial.println("");
digitalWrite(13, false);
}
}