Help needed for a computer fan PWM control project

Thanks robtillaart, it worked!

Have a question on your setup though. What does "Serial.begin" and "Serial.println" do? I didn't have these lines before but arduino still seems to understand my code and output the correct percentage duty cycle. Is there serial data transmission in this case (the reference says "begin" is for so Serial.begin() - Arduino Reference)? The reference also suggested Mega should use

Serial.begin(speed)
Serial1.begin(speed)
Serial2.begin(speed)
Serial3.begin(speed)

sounds like Mega can transfer data to computer at 4 different rate because it has 4 of something to do it?

Serial.println sounds like it will print something in a GUI? In this case it will print "start" somewhere, but when I compile it, I didn't see anywhere printing "start" (I'm using -0022).

Your code definitely looks cleaner than the one I posted, however, the binary sketch size is large (after I added serial1,2,3 to the code). Does binary size has anything to do with speed or anything? (I'm such a noob..)

Thanks again for the help! And does anyone have suggestions to part 2) and 3)?