I need to Run a DC Motor but in a scale...

If some one dons this please help


RadioScalefactor = ThrottleMax - ThrottleMin
CycleStep =10

Scale= ((Throttle - ThrottleMin) * 100/ RadioScalefactor )


If (CurrentStep < Scale) And (Scale <= 100) Then
While (CurrentStep * CycleStep < 100)
CurrentStep = CurrentStep + 1
Wend

While (CurrentStep * CycleStep > 100)
CurrentStep = CurrentStep - 1
Wend
End If
MotorDc=CurrentStep (Motor Speed)