Hi,
After i bought the http://www.seeedstudio.com/depot/315mhz-rf-link-kit-p-76.html Kit from Seeedstudio (and being slightly disappointed because it is not the one shown and has a different Pinout.. but thats another story) i tried to get it to work with Virtual library.. but as i only have one Arduino atm (the other one is in the mail) i tried to combine the trasnmitter and receiver code into one big chunk:
#include <VirtualWire.h>
#undef int
#undef abs
#undef double
#undef float
#undef round
void setup()
{
Serial.begin(19200); // Debugging only
Serial.println("setup");
/* TX auf 12 */
// Initialise the IO and ISR
vw_setup(2000); // Bits per sec
Serial.println("VWSetup");
/* RX auf 11 */
vw_rx_start(); // Start the receiver PLL running
Serial.println("RX Start");
}
void loop()
{
/** TX DATA **/
const char *msg = "hello";
digitalWrite(13, true); // Flash a light to show transmitting
vw_send((uint8_t *)msg, strlen(msg));
Serial.println("Send");
vw_wait_tx(); // Wait until the whole message is gone
Serial.println("TXdone");
digitalWrite(13, false);
/** RX DATA **/
uint8_t buf[VW_MAX_MESSAGE_LEN];
uint8_t buflen = VW_MAX_MESSAGE_LEN;
if (vw_get_message(buf, &buflen)) // Non-blocking
{
int i;
digitalWrite(13, true); // Flash a light to show received good message
// Message with a good checksum received, dump it.
Serial.print("RX: ");
for (i = 0; i < buflen; i++)
{
Serial.print(buf[i], HEX);
Serial.print(" ");
}
Serial.println("");
digitalWrite(13, false);
}
delay(200);
}
Now the problem is that the code does not get any further than to the 'setup' print. After that it seems simply as if it had stopped.
Is there anything i should know? I'm using 0013 as IDE on an Duemilanove with a 328p Chip.