aarg:
Doing that will answer 99% of your questions.
As I thought something is not working on the RX end. Unless you see a problem in the TX?
TX code:
#include <VirtualWire.h>
const byte Trigger = 111;
void setup()
{
// Initialise the IO and ISR
vw_set_tx_pin(0);
vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(2000); // Bits per sec
}
void loop()
{
vw_send(Trigger, 1);
vw_wait_tx(); // Wait until the whole message is gone
delay(200);
}
RX code:
#include <VirtualWire.h>
int Trigger = 0;
int LED = 4;
void setup()
{
pinMode(LED, OUTPUT);
// Initialise the IO and ISR
vw_set_rx_pin(0);
vw_set_ptt_inverted(true); // Required for DR3100
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))
{
Trigger = buf;
if(Trigger == 111)
{
digitalWrite(LED, HIGH);
delay(1000);
digitalWrite(LED, LOW);
delay(1000);
}
else
{
digitalWrite(LED, LOW);
}
}
}