What I had to do to get the libraries compile:
- edit VirtualWire.h includes: replace wiring.h with arduino.h
- edit VirtualWire.cpp: comment out WProgram.h include
I searched the web and found version 1.9 (http://www.open.com.au/mikem/arduino/) which compiles with Arduino 1.0.
WaveHC compiles without modification.
Both use Timer1 interrupts - the compilation error you get tells just this.
What can be done?
I have read there are two of those 8 bit timers and if I remember correctly they are only used for PWM output. So I would play with the VirtualWire library to get it running on the other timer and then you can add WaveHQ without the compiling trouble - this is what I achieved already, but I do not have any hardware to test the functionality of VirtualWire.
The following alterations could get you a working VirtualWire on Timer2, modifications on version 1.9
First is the function at line 253 of VirtualWire.cpp where I changed everything to Timer2 (hope you do not have an atmega168, no idea what the TIMSK1 anomaly here is)
// Speed is in bits per sec RF rate
void vw_setup(uint16_t speed)
// Calculate the OCR2A overflow count based on the required bit speed
// and CPU clock rate
uint16_t ocr2a = (F_CPU / 8UL) / speed;
// Set up timer2 for a tick every 62.50 microseconds
// for 2000 bits per sec
TCCR2A = 0;
TCCR2B = _BV(WGM12) | _BV(CS10);
// Caution: special procedures for setting 16 bit regs
OCR2A = ocr2a;
// Enable interrupt
TIMSK1 |= _BV(OCIE2A);
TIMSK |= _BV(OCIE2A);
// Set up digital IO pins
Second change is at line 416
the line with the compile error. Now the ISR for Timer2 is used.
I have no idea if this will work or if it is even good to take Timer2 for this purpose. Anyone with more experience here to look at this?