RF Link Transmitter/Reciever

Hi,

I got a sketch that works fine, but I’m a little confuse when looking at the code, as to, what determines the arduino data pin in the code? As i want to use a different pin on the Arduino.

-The transmitter data pin is connected to Pin 12 Arduino
-The receiver data pin is connected to Pin 11 of Arduino.

Here’s the website of hook up and code that I used:

Transmitter Sketch

   /*
SimpleSend
This sketch transmits a short text message using the VirtualWire library
connect the Transmitter data pin to Arduino pin 12
*/
#include <VirtualWire.h>
void setup()
{
// Initialize the IO and ISR
vw_setup(2000); // Bits per sec
}
void loop()
{
send("Hello there");
delay(1000);
}
void send (char *message)
{
vw_send((uint8_t *)message, strlen(message));
vw_wait_tx(); // Wait until the whole message is gone
}

Receiver Sketch

/*
SimpleReceive
This sketch displays text strings received using VirtualWire
Connect the Receiver data pin to Arduino pin 11
*/
#include <VirtualWire.h>
byte message[VW_MAX_MESSAGE_LEN]; // a buffer to store the incoming messages
byte messageLength = VW_MAX_MESSAGE_LEN; // the size of the message
void setup()
{
Serial.begin(9600);
Serial.println("Device is ready");
// Initialize the IO and ISR
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver
}
void loop()
{
if (vw_get_message(message, &messageLength)) // Non-blocking
{
Serial.print("Received: ");
for (int i = 0; i < messageLength; i++)
{
Serial.write(message[i]);
}
Serial.println();
}
}

Virtualwire defaults to using pin 11 as transmit and pin 12 as receive unless specifically changed using the "vw_set_tx_pin(uint8_t pin)" and "vw_set_rx_pin(uint8_t pin)" functions.