error in virtual wire libarary

Hi every one,

I download the latest version of the virtual wire library which contain:

#include <stdlib.h>
#if defined(ARDUINO)
#if ARDUINO >= 100
#include <Arduino.h>
#else
#include <wiring.h>
#endif

when I run the following codes:

#include <VirtualWire.h>

void setup()
{

pinMode(2, INPUT_PULLUP);
pinMode(3, INPUT_PULLUP);
pinMode(4, INPUT_PULLUP);
pinMode(5, INPUT_PULLUP);
Serial.begin(9600);
vw_set_tx_pin(8);
vw_setup(3000);
}

void loop()
{
int bt1 = digitalRead(2);
int bt2 = digitalRead(3);
int bt3 = digitalRead(4);
int bt4 = digitalRead(5);

Serial.print(bt1);
Serial.print(" “);
Serial.print(bt2);
Serial.print(” “);
Serial.print(bt3);
Serial.print(” “);
Serial.print(bt4);
Serial.println(” ");

if (bt1 == 0)
{
char msg[1] = {‘1’};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}

if (bt2 == 0)
{
char msg[1] = {‘2’};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}

if (bt3 == 0)
{
char msg[1] = {‘3’};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}

if (bt4 == 0)
{
char msg[1] = {‘4’};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);
}

char msg[1] = {‘0’};
vw_send((uint8_t *)msg, 1);
vw_wait_tx();
delay (5);

}

I got the following error:

Arduino: 1.5.6-r2 (Windows 7), Board: “Arduino Uno”

sketch_mar23a.ino: In function ‘void setup()’:
sketch_mar23a:13: error: ‘vw_set_tx_pin’ was not declared in this scope
sketch_mar23a:14: error: ‘vw_setup’ was not declared in this scope
sketch_mar23a.ino: In function ‘void loop()’:
sketch_mar23a:38: error: ‘vw_send’ was not declared in this scope
sketch_mar23a:39: error: ‘vw_wait_tx’ was not declared in this scope

please how i can fix this?

thanks in advance.

Does the library have any example code?

It’s because you have a smiley in your code :smiley:

Please read How to use this forum - please read and next edit your post and apply what you found regarding posting code.