Re: wiring.h

2,190 views
Skip to first unread message

Mike McCauley

unread,
Feb 6, 2012, 4:03:27 PM2/6/12
to From Yahoo, virtu...@googlegroups.com
Hello,

Apologies, there was an error in the documentation. The latest version is 1.9,
which you can download from

http://www.open.com.au/mikem/arduino/VirtualWire-1.9.zip

There is now a discussion group for VirtualWire at:

http://groups.google.com/group/virtualwire
and I have CCd that

It will compile with arduino 1.0 and earlier.

Cheers.

On Tuesday, February 07, 2012 06:32:57 AM you wrote:
> Yes V1 I did get the latest version and thats the error I am still getting
>
> In file included from MyVWRreceiver.cpp:4:0:
> /root/sketchbook/libraries/VirtualWire/VirtualWire.h:14:20: fatal error:
> wiring.h: No such file or directory compilation terminated.
>
>
>
> On Mon, 06 Feb 2012 08:54:50 +1000
>
> Mike McCauley <mi...@open.com.au> wrote:
> > Hello,
> >
> > Sounds like you are using Arduino 1.0?
> >
> > VirtualWire has been updated recently so it will build with 1.0. Please
> > download latest version.
> >
> > Also there is now a Google group for VirtualWire discussion, see the
> > latest version of the doc for details.
> >
> > Cheers.
> >
> > On Monday, February 06, 2012 08:19:58 AM you wrote:
> > > Hey there Mike
> > >
> > > I'm using your library "VirtualWire" again for another project but I
> > > keep getting this error , cant find "wiring.h"
> > >
> > > I saw on the forum replace "wiring.h" with "wiring_private.h" in the
> > > "Tone" library fixed it but I did not find a solution for my
> > > problem yet
> > >
> > > Do you know what happened to "wiring.h" ?
--
Mike McCauley mi...@open.com.au
Open System Consultants Pty. Ltd
9 Bulbul Place Currumbin Waters QLD 4223 Australia http://www.open.com.au
Phone +61 7 5598-7474 Fax +61 7 5598-7070

Radiator: the most portable, flexible and configurable RADIUS server
anywhere. SQL, proxy, DBM, files, LDAP, NIS+, password, NT, Emerald,
Platypus, Freeside, TACACS+, PAM, external, Active Directory, EAP, TLS,
TTLS, PEAP, TNC, WiMAX, RSA, Vasco, Yubikey, MOTP, HOTP, TOTP,
DIAMETER etc. Full source on Unix, Windows, MacOSX, Solaris, VMS, NetWare etc.

Message has been deleted

Ty

unread,
Feb 6, 2012, 5:01:16 PM2/6/12
to virtualwire
Mike I got 1.9 but still get that same error-Ill just recheck--Yep
just the same
here's what I am trying to compile

/* Receiver *
* *
* */
#include <VirtualWire.h>
char msg[50]="";
char temp[5]="";
int itemp;
float ftemp;

void setup()
{
vw_set_rx_pin(11); //defaults to 11 but you can change it if you
wish
vw_set_tx_pin(12); // defaults to 12
Serial.begin(9600); // Debugging only
Serial.println("setup and waiting for transmission");
// Initialise the IO and ISR
vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(2000); // Bits per sec
vw_rx_start(); // Start the receiver PLL running
}

void cutMsg()
{
char loc1[10]="";
char loc2[10]="";
char ctemp1[5]="";
char ctemp2[5]="";
int itemp;
float ftemp1;
float ftemp2;
char *pch;

while (pch !=NULL){

pch=strtok(msg,",");
for (int i=0;1<strlen(pch)+1;i++){
loc1[i]= *pch;
pch++;}
Serial.println(loc1);

pch=strtok(NULL,",");
for (int i=0;1<strlen(pch)+1;i++){
ctemp1[i]=*pch;
pch++;}
Serial.println(ctemp1);
ftemp1=atof(ctemp1);
ftemp1=ftemp1/100;
Serial.println(ftemp1);

pch=strtok(NULL,",");
for (int i=0;1<strlen(pch)+1;i++){
loc2[i]=*pch;
pch++;}
Serial.println(loc2);

pch=strtok(NULL,",");
for (int i=0;1<strlen(pch)+1;i++){
ctemp2[i]=*pch;
pch++;}
Serial.println(ctemp2);
ftemp2=atof(ctemp2);
ftemp2=ftemp2/100;
Serial.println(ftemp2);

pch=strtok(NULL,",");
Serial.print(loc1);
Serial.print (" ");
Serial.println (ftemp1);
Serial.print(loc2);
Serial.print (" ");
Serial.println (ftemp2);

}
}
void loop()
{
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &buflen)) // Non-blocking
{
for (int i=0;i<50;i++) msg[i]=0;
digitalWrite(13, true); // Flash a light to show received good
message
// Message with a good checksum received, dump it.

Serial.print("Got: ");
for (int i = 0; i < buflen; i++)
{
Serial.print(buf[i], BYTE);
msg[i]=buf[i];
}
Serial.println();
cutMsg();
}
digitalWrite(13, false);

}

Mike McCauley

unread,
Feb 6, 2012, 5:04:05 PM2/6/12
to virtu...@googlegroups.com
Hello,

I am unable to read whatever it was you posted. Perhaps its HTML? Can you post
in a format thats readable?

Anyway, are you able to compile any of the example programs that came with
VirtualWire?

What version of arduino are you using?

Cheers.

On Monday, February 06, 2012 01:57:36 PM Ty wrote:
> Mike I got 1.9 but still get that same error-Ill just recheck--Yep
> just the same
> here's what I am trying to compile

> [quote]
> [color=#7E7E7E]/* Receiver *[/color]
> [color=#7E7E7E] * *[/color]
> [color=#7E7E7E] * */[/color]
> #include <VirtualWire.h>
> [color=#CC6600]char[/color] msg[50]=[color=#006699]""[/color];
> [color=#CC6600]char[/color] temp[5]=[color=#006699]""[/color];
> [color=#CC6600]int[/color] itemp;
> [color=#CC6600]float[/color] ftemp;
>
> [color=#CC6600]void[/color] [color=#CC6600][b]setup[/b][/color]()
> {
> vw_set_rx_pin(11); [color=#7E7E7E]//defaults to 11 but you can
> change it if you wish[/color]
> vw_set_tx_pin(12); [color=#7E7E7E]// defaults to 12 [/color]
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]begin[/color]
> (9600); [color=#7E7E7E]// Debugging only[/color]
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color]
> ([color=#006699]"setup and waiting for transmission"[/color]);
> [color=#7E7E7E]// Initialise the IO and ISR[/color]
> vw_set_ptt_inverted([color=#CC6600]true[/color]); [color=#7E7E7E]//
> Required for DR3100[/color]
> vw_setup(2000); [color=#7E7E7E]// Bits per sec[/color]
> vw_rx_start(); [color=#7E7E7E]// Start the receiver PLL
> running[/color]
> }
>
> [color=#CC6600]void[/color] cutMsg()
> {
> [color=#CC6600]char[/color] loc1[10]=[color=#006699]""[/color];
> [color=#CC6600]char[/color] loc2[10]=[color=#006699]""[/color];
> [color=#CC6600]char[/color] ctemp1[5]=[color=#006699]""[/color];
> [color=#CC6600]char[/color] ctemp2[5]=[color=#006699]""[/color];
> [color=#CC6600]int[/color] itemp;
> [color=#CC6600]float[/color] ftemp1;
> [color=#CC6600]float[/color] ftemp2;
> [color=#CC6600]char[/color] *pch;
>
> [color=#CC6600]while[/color] (pch !=NULL){
>
> pch=strtok(msg,[color=#006699]","[/color]);
> [color=#CC6600]for[/color] ([color=#CC6600]int[/color]


> i=0;1<strlen(pch)+1;i++){
> loc1[i]= *pch;
> pch++;}

> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color]
> (loc1);
>
> pch=strtok(NULL,[color=#006699]","[/color]);
> [color=#CC6600]for[/color] ([color=#CC6600]int[/color]


> i=0;1<strlen(pch)+1;i++){
> ctemp1[i]=*pch;
> pch++;}

> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color]
> (ctemp1);
> ftemp1=atof(ctemp1);
> ftemp1=ftemp1/100;
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color]
> (ftemp1);
>
> pch=strtok(NULL,[color=#006699]","[/color]);
> [color=#CC6600]for[/color] ([color=#CC6600]int[/color]


> i=0;1<strlen(pch)+1;i++){
> loc2[i]=*pch;
> pch++;}

> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color]
> (loc2);
>
> pch=strtok(NULL,[color=#006699]","[/color]);
> [color=#CC6600]for[/color] ([color=#CC6600]int[/color]


> i=0;1<strlen(pch)+1;i++){
> ctemp2[i]=*pch;
> pch++;}

> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color]
> (ctemp2);
> ftemp2=atof(ctemp2);
> ftemp2=ftemp2/100;
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/color]
> (ftemp2);
>
> pch=strtok(NULL,[color=#006699]","[/color]);
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color]
> (loc1);
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color]
> ([color=#006699]" "[/color]);
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/
> color] (ftemp1);
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color]
> (loc2);
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color]
> ([color=#006699]" "[/color]);
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/
> color] (ftemp2);
>
> }
> }
> [color=#CC6600]void[/color] [color=#CC6600][b]loop[/b][/color]()
> {


> uint8_t buf[VW_MAX_MESSAGE_LEN];
> uint8_t buflen = VW_MAX_MESSAGE_LEN;
>

> [color=#CC6600]if[/color] (vw_get_message(buf, &buflen))
> [color=#7E7E7E]// Non-blocking[/color]
> {
> [color=#CC6600]for[/color] ([color=#CC6600]int[/color] i=0;i<50;i+
> +) msg[i]=0;
> [color=#CC6600]digitalWrite[/color](13, [color=#CC6600]true[/
> color]); [color=#7E7E7E]// Flash a light to show received good
> message[/color]
> [color=#7E7E7E]// Message with a good checksum received, dump it.[/
> color]
>
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/color]
> ([color=#006699]"Got: "[/color]);
> [color=#CC6600]for[/color] ([color=#CC6600]int[/color] i = 0; i
> < buflen; i++)
> {
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]print[/
> color](buf[i], BYTE);
> msg[i]=buf[i];
> }
> [color=#CC6600][b]Serial[/b][/color].[color=#CC6600]println[/
> color]();
> cutMsg();
> }
> [color=#CC6600]digitalWrite[/color](13, [color=#CC6600]false[/
> color]);
>
> }
>
>
> [/quote]

From Yahoo

unread,
Feb 7, 2012, 6:33:19 AM2/7/12
to virtu...@googlegroups.com
On Tue, 07 Feb 2012 08:04:05 +1000
Mike McCauley <mi...@open.com.au> wrote:

> Hello,
>
> I am unable to read whatever it was you posted. Perhaps its HTML? Can you post
> in a format thats readable?
>
> Anyway, are you able to compile any of the example programs that came with
> VirtualWire?
>
> What version of arduino are you using?
>
> Cheers.

That was a copy for the forum in Arduino Version 1.0
I reposted it as text from the sketch window
Did you see that?

Anyway the first copy for forum gives it all a font colour and thats what you could not understand.

Here it is again in text in case

/* Receiver *
* *
* */
#include <VirtualWire.h>
char msg[50]="";
char temp[5]="";
int itemp;
float ftemp;

void setup()
{

vw_set_rx_pin(11); //defaults to 11 but you can change it if you wish


vw_set_tx_pin(12); // defaults to 12
Serial.begin(9600); // Debugging only

Serial.println("setup and waiting for transmission");


// Initialise the IO and ISR

vw_set_ptt_inverted(true); // Required for DR3100
vw_setup(2000); // Bits per sec

vw_rx_start(); // Start the receiver PLL running
}

void cutMsg()
{
char loc1[10]="";
char loc2[10]="";
char ctemp1[5]="";
char ctemp2[5]="";
int itemp;
float ftemp1;
float ftemp2;
char *pch;

while (pch !=NULL){

pch=strtok(msg,",");

for (int i=0;1<strlen(pch)+1;i++){


loc1[i]= *pch;
pch++;}

Serial.println(loc1);

pch=strtok(NULL,",");
for (int i=0;1<strlen(pch)+1;i++){
ctemp1[i]=*pch;
pch++;}


Serial.println(ctemp1);
ftemp1=atof(ctemp1);
ftemp1=ftemp1/100;
Serial.println(ftemp1);

pch=strtok(NULL,",");

for (int i=0;1<strlen(pch)+1;i++){
loc2[i]=*pch;
pch++;}
Serial.println(loc2);

pch=strtok(NULL,",");
for (int i=0;1<strlen(pch)+1;i++){
ctemp2[i]=*pch;
pch++;}


Serial.println(ctemp2);
ftemp2=atof(ctemp2);
ftemp2=ftemp2/100;
Serial.println(ftemp2);

pch=strtok(NULL,",");
Serial.print(loc1);
Serial.print (" ");
Serial.println (ftemp1);
Serial.print(loc2);
Serial.print (" ");
Serial.println (ftemp2);

}
}
void loop()
{

uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;

if (vw_get_message(buf, &buflen)) // Non-blocking


{
for (int i=0;i<50;i++) msg[i]=0;

digitalWrite(13, true); // Flash a light to show received good message


// Message with a good checksum received, dump it.

Serial.print("Got: ");
for (int i = 0; i < buflen; i++)
{
Serial.print(buf[i], BYTE);
msg[i]=buf[i];
}
Serial.println();
cutMsg();
}
digitalWrite(13, false);

}

Mike McCauley

unread,
Feb 7, 2012, 6:43:23 AM2/7/12
to virtu...@googlegroups.com
Hello,

On Tuesday, February 07, 2012 07:33:19 PM From Yahoo wrote:
> On Tue, 07 Feb 2012 08:04:05 +1000
>
> Mike McCauley <mi...@open.com.au> wrote:
> > Hello,
> >
> > I am unable to read whatever it was you posted. Perhaps its HTML? Can
> > you post in a format thats readable?
> >
> > Anyway, are you able to compile any of the example programs that came
> > with VirtualWire?

What is the answer to that question?

> >
> > What version of arduino are you using?
> >
> > Cheers.
>
> That was a copy for the forum in Arduino Version 1.0

VirtualWire and its example programs compile under arduino 1.0 and earlier
versions.

From Yahoo

unread,
Feb 7, 2012, 5:22:46 PM2/7/12
to virtu...@googlegroups.com
No the same error appears

Mike McCauley

unread,
Feb 7, 2012, 5:47:41 PM2/7/12
to virtu...@googlegroups.com
Hello,

Im not sure you are running what you think you are running.

When I compile your example code, posted a few days ago, with arduino 1.0, and
the latest version of VirtualWire, I get this compiler error from your code:

sketch_feb08a.cpp: In function 'void loop()':
sketch_feb08a:88: error: 'BYTE' was not declared in this scope

As of Arduino 1.0, the 'BYTE' keyword is no longer supported.
Please use Serial.write() instead.

Under arduino-0021, your example code compiles fine.

Are you sure you have VirtualWire-1.9 unpacked in the right place?


Cheers.

From Yahoo

unread,
Feb 7, 2012, 11:27:25 PM2/7/12
to virtu...@googlegroups.com
Thanks Mike . I have not been able to get that far yet to correct BYTE

The first problem is that VirtualWire.h calls wiring.h
wiring.h does not appear in Arduino_1.0 or in VirtualWire_1.9 .

So I am wondering why it is called or is it an error and should not be called.

See attached screenshot . Your library is in /sketchbook/libraries/
Psearch did not find wiring.h on my computer at all.


--
From Yahoo <tyt...@yahoo.com>

From Yahoo

unread,
Feb 7, 2012, 11:29:12 PM2/7/12
to virtu...@googlegroups.com
Opps forgot to attach file
ScreenVirtualWireFiles.png

Ty

unread,
Feb 7, 2012, 10:08:58 PM2/7/12
to virtualwire
This becomes somewhat confused doing it on yahoo groups-There are only
2 posters so far -Me and Mike

I cannot run the examples - the same error appears
I do not have wiring.h on my machine yet it is called by VirtualWire.h
I have your library in the right place I think /root/sketchbook/
libraries

Mike McCauley

unread,
Feb 8, 2012, 1:54:49 AM2/8/12
to virtu...@googlegroups.com
Hi,

I think you still have some old version of VirtualWire installed in
/root/sketchbook/libraries/VirtualWire/

Ty

unread,
Feb 8, 2012, 6:50:34 AM2/8/12
to virtualwire
OK got it now

#if ARDUINO >= 100
#include <Arduino.h>
#else
#include <wiring.h>
#endif

wayne davis

unread,
Nov 13, 2015, 6:46:24 AM11/13/15
to virtualwire
where have you posted this code?
am using arduino 1.6.5 and its givin me this errorĀ 










transmitter_test.ino:3:25: fatal error: VirtualWire.h: No such file or directory
compilation terminated.
Error compiling.

can u help please?

Mike McCauley

unread,
Nov 13, 2015, 7:13:41 AM11/13/15
to virtu...@googlegroups.com
Hello,

This VirtualWire library has now been superceded by the RadioHead
library http://www.airspayce.com/mikem/arduino/RadioHead
RadioHead and its RH_ASK driver provides all the features supported by
VirtualWire, and much more
besides, including Reliable Datagrams, Addressing, Routing and Meshes. All the
platforms that
VirtualWire supported are also supported by RadioHead.
--
Mike McCauley VK4AMM mi...@airspayce.com
Airspayce Pty Ltd 9 Bulbul Place Currumbin Waters QLD 4223 Australia
http://www.airspayce.com
Phone +61 7 5598-7474

Reply all
Reply to author
Forward
0 new messages