data[idx++] = Serial.
read(); // read &
print
lcd.print(data[idx-1]);
delay(wait);
}
}
else
{
lcd.setCursor(0,2);; //move back to the second
position
lcd.print(data[idx-1]);
delay(wait);
}
}
else //otherwise the value equals 32 and we are at the
end of the second line
{
lcd.setCursor(0,3);; //third line
lcd.print(data[idx-1]);
delay(wait);
}
}
else // it equals 20 and you are at the end of the first
line
{
lcd.setCursor(0,4);; //so go to the fouth line
data[idx++] = Serial.read(); //read & print
lcd.print(data[idx-1]);
delay(wait);
}
}
} //end while
idx = 0;