Daz1712:
Have a look at this.Daz
That's not a good example for this case: although it uses a transistor, it uses it to switch the Arduino's 5V supply to the motor, which is not what OP needs with a 400mA motor.
Daz1712:
Have a look at this.Daz
That's not a good example for this case: although it uses a transistor, it uses it to switch the Arduino's 5V supply to the motor, which is not what OP needs with a 400mA motor.