VirtualWire Library Read Command ?

Hello Everyone,

I am using "XD-RF-5v" part on arduino.My aim is that pushing the keyboard which is connected to the computer of transmitter part of the module. And then, reading the signal (which is char) and transmit it to the recieving computer. Normally (without any library and module) ,when i push the keyboard i can read the signal (which is char) in serial monitor with just using one arduino.And this codes in loop function is below :

void loop()
{
while(Serial.available()==0);
int val = Serial.read();
Serial.println(val);
}

However in virtualwire library, i used the codes in loop function below :

void loop()
{
while(Serial.available()==0);
int val =Serial.read(); // I assume that the problem is here.
char msg[24];
sprintf(msg ,"%i",val);
vw_send((uintf8_t *)msg, strlen(msg));
vw_wait_tx();
delay(200);
}
With this code,i could not read anything.There is nothing at the receiver part.
My question is that is there any "read" command in this library to read the char when i push the keyboard,i.e i can read it and transmit it to the receiver.
Or how can i solve this problem ?

And I am so sorry about misunderstanding points if there are.
Regards and thank you for commands to all.

Is there any suggestion to solve this trouble ?

I don't see a problem or a trouble, except that all the code is in comments.

If you have a question, please read and follow the directions in "How to use this forum".

The real problem, is that nobody can understand you. You'll have to explain it better.

jremington:
If you have a question, please read and follow the directions in "How to use this forum".

I am sorry about that. As the "VirtualWire" library is really common library , i assume that people can understand the codes or etc. easily. I will edit the question. Moreover, i ask a few question to this forum. I would prefer you to guide me instead of your first reply.

We still have NO IDEA what your question is.

jremington:
We still have NO IDEA what your question is.

I editted it sir. Thank you..

When posting code, please post all your code, using code tags. If you don't know what code tags are, please read "How to use this forum".

If the rest of the program is correct and you have the Arduino and transmitter wired correctly, the loop below should transmit a very short message each time a character is entered on the keyboard. The message will be the decimal value of the ASCII representation of the character entered on the keyboard. EXCEPT that you misspelled "uint8_t", so it won't even compile correctly.

void loop()
{
    while(Serial.available()==0);
    int val =Serial.read(); // I assume that the problem is here.
    char msg[24];
    sprintf(msg ,"%i",val);
    vw_send((uintf8_t *)msg, strlen(msg));
    vw_wait_tx();
    delay(200);
}

How are you trying to receive this message?

Note: to get started with VirtualWire, make sure that the simple example programs work, and that you understand them, before doing anything else.

I have an idea. Please show a diagram of your system.