Hello to all,
I was building a project to test the 434 MHz transmitters and receivers i bought recently. However I had only one Arduino (UNO) . So i figured that connecting the data pin of the receiver to the RX pin and using the Serial Library would solve my problem. I used Virtual Wire Library for the transmitter side. Sadly, it did not work.
The connections are as follows:
transmitter
vcc ---- 5v
gnd ---- gnd
data----- d12
ant ------NC
receiver
vcc --- 5v
gnd --- gnd
data --- d0 (rx)
ant ----- NC
/* transmit = VirtualWire ; receive = Serial
Unsuccesful as of 19/3/15
*/
#include <VirtualWire.h>
const int led_pin = 8;
const int transmit_pin = 12;
const int transmit_en_pin = 3;
char rec;
int i = 0;
int r;
void setup()
{
  // Initialise the IO and ISR
  Serial.begin(9600);
  Serial.println ("Setup has begun");
  vw_set_tx_pin(transmit_pin);
  vw_setup(2000);   // Bits per sec
  pinMode(led_pin, OUTPUT);
  Serial.println ("Setup completed");
}
void loop()
{
Serial.println ("Sending");
 vw_send((uint8_t *)i,1);
 vw_wait_tx(); // Wait until the whole message is gone
 Serial.println ("Sent");
 delay(1000);
 i != i;
 Serial.print ("i = \t");
 Serial.println (i);
Â
 /* receiving */
 if (Serial.available()){
  Serial.print ("Transfer succesful!! Now receiving");
  rec = Serial.read();
  Serial.print ("I received: \t");
  Serial.println (rec);
 }
}
Moderator edit: Code added
transmitter.ino (900 Bytes)