Using Arduino PWM
When using Pulse Width Modulation to control motor speed, rotation of the motor is controlled by applying and removing Voltage. In the simulation the Arduino PWM functions analogWrite(Pin, Number) where Pin is the digital out and number is the value 0-255 which controls the time on increments.