kv = 65535 / 13.4 # conversion from Volts to PWM kw = 0.16*pi # conversion from counts to rad/sec V = 0 while(V < 13.4): fwd.duty_u16(int(V*kv)) rev.duty_u16(0) sleep(0.5) Speed = N12*kw print('{: 7.4f}'.format(V), '{: 7.4f}'.format(Speed), N12) V += 0.1 print('Stop') fwd.duty_u16(0) rev.duty_u16(0)