We connected the motor for a drill to pin 6. I can turn the motor on or off by setting the pin high or low, but now we’d like to use PWM to control it. When I use the following example code, nothing happens:
from pyb import Pin, Timer
p = Pin(‘P6’)
tim = Timer(2, freq=10)
ch = tim.channel(1, Timer.PWM, pin=p)
Could you please let me know what is the issue?