The frequency is governed by the speed you pulse your drive. That code is not PWM Each digital write takes about 2.5 uS.