Pages: [1]   Go Down
Author Topic: Virtual Wire library error  (Read 115 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So i have downloaded the VirtualWire library and installed it... now when i check/compile the sketch i get errors:
Code:
In file included from sketch_sep28a.ino:1:
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:54: error: variable or field 'vw_set_tx_pin' declared void
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:54: error: 'uint8_t' was not declared in this scope
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:58: error: variable or field 'vw_set_rx_pin' declared void
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:58: error: 'uint8_t' was not declared in this scope
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:62: error: variable or field 'vw_set_ptt_pin' declared void
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:62: error: 'uint8_t' was not declared in this scope
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:66: error: variable or field 'vw_set_ptt_inverted' declared void
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:66: error: 'uint8_t' was not declared in this scope
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: variable or field 'vw_setup' declared void
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:71: error: 'uint16_t' was not declared in this scope
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:90: error: 'uint8_t' does not name a type
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:96: error: 'uint8_t' does not name a type
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:99: error: 'uint8_t' does not name a type
C:\***\Arduino\libraries\VirtualWire/VirtualWire.h:104: error: 'uint8_t' does not name a type
sketch_sep28a.ino: In function 'void setup()':
sketch_sep28a:11: error: 'vw_set_tx_pin' was not declared in this scope
sketch_sep28a:12: error: 'vw_set_rx_pin' was not declared in this scope
sketch_sep28a:13: error: 'vw_set_ptt_pin' was not declared in this scope
sketch_sep28a:14: error: 'vw_set_ptt_inverted' was not declared in this scope
sketch_sep28a:15: error: 'vw_setup' was not declared in this scope
sketch_sep28a.ino: In function 'void loop()':
sketch_sep28a:26: error: 'vw_send' was not declared in this scope


and this is the sketch:
Code:
#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_tx_pin(transmit_pin);
  vw_set_rx_pin(receive_pin);
  vw_set_ptt_pin(transmit_en_pin);
  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);
  delay(1000);
  count = count + 1;
}
Logged

Johannesburg. UTC+2
Offline Offline
Faraday Member
**
Karma: 114
Posts: 4961
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You sure the library's in the right place?- easy to get the unzip into the wrong folder layer.

Also, some libraries- I don't know about that one- have  "-Master" or similar on the end and I end up renaming; not sure if that's the right way but it works for me.
Logged

The Elders of the Internet know who I am
I'm on LinkedIn: http://www.linkedin.com/in/jimbrownza

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I think that the library is in the right place. It is in libraries folder and it is showing up on the list in the IDE...
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Or can anyone know any other librarys that are for RF links ?
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 654
Posts: 50931
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So i have downloaded the VirtualWire library
From?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

From here: https://www.pjrc.com/teensy/td_libs_VirtualWire.html
Logged

Seattle, WA USA
Online Online
Brattain Member
*****
Karma: 654
Posts: 50931
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's the same version I have. On 1.0.5, on Win7, with Duemilanove as the board type, the only error I get is:
Quote
Binary sketch size: 3,776 bytes (of a 30,720 byte maximum)

What board type are you selecting? What operating system? What version of the IDE?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's the same version I have. On 1.0.5, on Win7, with Duemilanove as the board type, the only error I get is:
Quote
Binary sketch size: 3,776 bytes (of a 30,720 byte maximum)

What board type are you selecting? What operating system? What version of the IDE?

I am using Arduino Uno and Mega, Windows 7 Ultimate 64bit and IDE version: 1.0.5-r2
Logged

Pages: [1]   Go Up
Jump to: