Need some help with my code ,please

There's no need to apologize...all of us have been there. We're just trying to understand what you're trying to do and point you in the right direction.

It appears that, depending on the reading of previousPosition, the for loops adjust by the 3rd expression in the for loop, either to raise something (temperature??) or lower it:

previousPosition += 1

or

previousPosition -= 1

In both loops, the comparison is made to servonormal. If that's the case, why not use:

while (previousPosition != seronormal) {
   // get the data here
   if (previousPosition < servonormal)
      previousPosition++;      // same as previousPosition += 1
   else 
      previousPosition--;      // same as previousPosition -= 1
}

I think this is what you are trying to do.