First, we see the Motor class definition and its constructor:
class Motor:
def __init__(self, pi, enable_gpio, logic_1_gpio, logic_2_gpio):
self.pi = pi
self.enable_gpio = enable_gpio
self.logic_1_gpio = logic_1_gpio
self.logic_2_gpio = logic_2_gpio
pi.set_PWM_range(self.enable_gpio, 100) # speed is 0..100 # (1)
# Set default state - motor not spinning and
# set for right direction.
self.set_speed(0) # Motor off # (2)
self.right()
At line 1, we are defining the PiGPIO PWM duty cycle range for the enable pin to be in the range 0..100. This defines the maximum range value (that is, 100) that we can use with the set_speed() function that we'll come to shortly.
The range 0..100 means we have 101 discrete integer PWM steps, which maps conveniently to a 0% to 100% duty cycle. If you specify a higher number, this does not mean more duty cycles (or more motor speed); it just changes the granularity...