I still think this statement:
for (previousPosition != 0; previousPosition < servocold; previousPosition += 1)
is suspect, because the expression:
previousPosition != 0
is either logic True (1), or false (0). You may think it's working as you want it to, but I serious doubt it. The only reason it works is because the logic conditions start the loop either with 0 or 1, depending on the logic state. There is nothing in the ANSI standard for C that requires logic True to be 1 and logic False to be 0. Indeed, some early compilers used -1 for True and still others used -1 for False. Also, as you've written the loop, it tests a "position" against "servocold", which is either strange or a poor choice of variable names. Finally, just because serendipity makes a program work doesn't mean it's properly coded. Such things come back to bite you later on.