This will never be true:
fanstart == 255
You're incrementing in steps of 20. Write something much simpler - just hard code a few values and put a decent delay between them.
This will never be true:
fanstart == 255
You're incrementing in steps of 20. Write something much simpler - just hard code a few values and put a decent delay between them.