hold last sensor value

Yes do you mean something like this:-

tempVal = analogRead(posPin);
if(tempVal !=0) posVal = tempVal;