First project - help with code and vibration motor

O.k. a couple of problems. You have written on your diagram that the 3.3V pin can deliver 50mA safely. Then you've connected it to a motor that needs 75mA and you're surprised that it doesn't work?

Also that transistor will lose a fair amount of the 3.3V, probably more that you think because you're not providing nearly enough base current to switch it fully on. Where did you get the value 1k for the base resistor from?

Steve