Need some help with my code ,please

In several places you have:

for(previousPosition != 0; previousPosition < servocold; previousPosition += 1)  // goes from 0 degrees to 180 degrees

A for loop has 3 expressions:

  1. the starting condition of the variable that controls the loop
  2. a (relational) test that determines if another iteration through the loop is needed
  3. usually a change in the variable that controls the loop.
    Your expression 1 looks suspect, since it is a relational test, not what is usually an assignment statement. Given your comment, it probably needs to look something like:
int degrees;

for(degrees = 0; degrees < servocold; degrees++)  // goes from 0 degrees to 180 degrees

This code marches through from 0 up to servocold 1 degree at a time.

Also, when you post code here, place your cursor in the IDE source code window, press Ctrl-T, which formats it for you. Then press Ctrl-A to copy all of your code. Then come to this forum, start your post, hit the pound sing (#) and copy your code between the two code tags. That makes it easier for us.