problems with Serial.available()


I am trying to read data coming from my AX12 to the RX1 pin of my arduino mega.

I use this part of code, after asking my AX12 to send his position :

    int i = 0;
    while(Serial1.available() <= 0)
    v1 = i;
    v2 = Serial.available();

Then I print the values v1 and v2 (later, because I had some problems when trying to use Serial.print when I am doing something else.)

I find :
v1 = 16 or 17, it depends.
v2 = 0

How is that possible ?

Thank you

Seems like it's taking 16 or 17 times 50 microseconds (800 to 850 microseconds) for a character to arrive at Serial1. The fact that no character has arrived at Serial is perfectly understandable. Perhaps you meant to check Serial1?