Interesting, you should delete the VirtualWire file and unzip it again. I have it working for 0017 just fine.
Did you recently change any files other than the VirutalWire?
Also, somebody suggested this when they had problems.. but it should be included in the example:
include these at the top of your sketch
You were right, adding the lines worked. It is strange that the example didn't have the code. Looks like I will need to stop assuming that example code works.
mem,
I tried your suggestion and more errors than before:
from C:\Arduino\arduino-0017\hardware\libraries\VirtualWire\VirtualWire.cpp:17:
c:/arduino/arduino-0017/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected unqualified-id before 'int'
c:/arduino/arduino-0017/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'
c:/arduino/arduino-0017/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'
from C:\Arduino\arduino-0017\hardware\libraries\VirtualWire/VirtualWire.h:16,
from C:\Arduino\arduino-0017\hardware\libraries\VirtualWire\VirtualWire.cpp:17:
c:/arduino/arduino-0017/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'
c:/arduino/arduino-0017/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
c:/arduino/arduino-0017/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
Strange, all the examples compile ok for me. Here are the first few lines of the cpp and .h files that I used
VirtualWire.cpp:
// $Id: VirtualWire.cpp,v 1.4 2009/03/31 20:49:41 mikem Exp mikem $ #include "VirtualWire.h" #include <util/crc16.h> #include <wiring.h> // this was moved from the .h file to the cpp file
VirtualWire.h:
// $Id: VirtualWire.h,v 1.3 2009/03/30 00:07:24 mikem Exp $ #ifndef VirtualWire_h #define VirtualWire_h #include "WProgram.h" // this was moved from the cpp file to the .h file #include <stdlib.h>
I have uploaded a new version 1.4 of VirtualWire which should fix compile problems for all platforms. Pls let me know if any further problems are observed.