Virtual Wire Help - error messages

Hey guys,

Does anyone know what this error means :

'cast from 'uint8_t* to byte' loses precision'

This is the receiver sketch I;m using for my project:

#include <VirtualWire.h>

byte ledPin = 13;

void setup()
{
// Initialise the Wireless Receiver IO and ISR

vw_set_rx_pin(9);
// set the Bits per sec
vw_setup(2000);
// Start the receive PLL running
vw_rx_start();
}

void loop(){
// **********************************************************************************************
// look for wireless input or for unsolicited message from arduino2

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(ledPin, LOW); // Turn on LED to show working a message

// Message with a good checksum received, dump it.
Serial.println("Got: "); // Show on PC for debugging

for (i = 0; i < buflen; i++)
{
Serial.print(byte(buf));
}
digitalWrite(ledPin, HIGH);
Serial.println(""); // spaces it out for the monitor
}
}

Any help?? Thanks

Feda:
'cast from 'uint8_t* to byte' loses precision'

buf is a pointer to an array of bytes, yet you are trying to use it as a byte. You should be using

buf[i]

to deference the characters. Another good example of why using the code tags when posting code is important.

Thank you so much.

I managed to get it compiling but it isn't doing what I want it to do. I'm not receiving anything from the transmitter. I'm trying to transmit analogue values from different sensors (I used a multiplexer for the analogue signals) and then receive it in the same format at the receiving end. This is the receiving end code, could anyone help or am I in the wrong place?

#include <VirtualWire.h>

byte ledPin = 13;

void setup() // stuff that runs once before looping forever
{
  Serial.begin(9600);
  // Initialise the Wireless Receiver IO and ISR
  // set Virtual Wire data input to Pin 9
  vw_set_rx_pin(9);
  // set the Bits per sec 
  vw_setup(2000);
  // Start the receive PLL running
  vw_rx_start();

}
void loop(){ 
  // **********************************************************************************************
  // look for wireless input or for unsolicited message from arduino2

  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(ledPin, LOW); // Turn on LED to show working a message

    // Message with a good checksum received, dump it.
    Serial.println("Got: ");  // Show on PC for debugging

    for (i = 0; i < buflen; i++)
    {
      Serial.print(byte(buf[i]));
    }
    digitalWrite(ledPin, HIGH);
    
    Serial.println(""); // spaces it out for the monitor
  }
}

Any suggestions?

Please edit your post and add code tags around the sketch. That will prevent it turning to italics part way through. Select the sketch part and click the '#' button above the text entry box.

Sorry for that and thanks.

I'm not receiving anything from the transmitter. ... This is the receiving end code.

If you are not receiving anything, then it is not likely that the problem is on the receiver, is it?