VirtualWire program not compiling

I’m relatively new to all this.

So, I have the latest VirtualWire library in the library folder (version 1.10), but every time I try to run the sample transmitter program, I get

‘vw_set_tx_pin’ was not declared in this scope

Here is the sample code:

// transmitter.pde
// Simple example of how to use VirtualWire to transmit messages
// Implements a simplex (one-way) transmitter with an TX-C1 module
// See VirtualWire.h for detailed API docs
// Author: Mike McCauley (
// Copyright (C) 2008 Mike McCauley
// $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $

#include <VirtualWire.h>

const int led_pin = 11;
const int transmit_pin = 12;
const int receive_pin = 2;
const int transmit_en_pin = 3;

void setup()
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(2000); // Bits per sec

byte count = 1;

void loop()
char msg[7] = {‘h’,‘e’,‘l’,‘l’,‘o’,’ ‘,’#’};

msg[6] = count;
digitalWrite(led_pin, HIGH); // Flash a light to show transmitting
vw_send((uint8_t *)msg, 7);
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(led_pin, LOW);
count = count + 1;

I’ve been scouring the forums and I’ve tried redownloading the library and replacing the old one, restarting the IDE, etc.

Any ideas on what to do?

Any ideas on what to do?

You could tell us what version of the IDE you are using. You could tell us what error messages you are getting.

I copied the code into the 1.0.1 IDE, and got several errors. I am using an older version of the library, apparently. I needed to change wiring.h to Arduino.h in VirtualWire.h, and remove the include of WProgram.h from VirtualWire.cpp. Then, the code compiled.