Fan and Digital Input

miguelmurca:
I see... Thank you very much!

I've googled transistors a bit... From what I've got, when the pin connected to it is HIGH, the transistor lets the power supply through it to the motor? And with PWM pins, the higher the output, the more voltage it lets through? (There's a big chance I got it wrong.)

The tutorial at Transistor Circuits is a good read. The "transistor as switch" section is what you want to study. Make note of the protection diode and resistor used in that circuit as you need to employ both to protect your Arduino.

PWM (pulse width modulation) pulses the voltage to the motor, so strictly speaking it's jumping between 5V and 0V.