File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -364,10 +364,13 @@ def _check_pwm_channel(self, pin_num):
364364 channel = PWMOutputDevice .PIN_TO_PWM_CHANNEL [pin_num ]
365365 if channel in PWMOutputDevice ._channels_used .keys ():
366366 raise PWMChannelAlreadyInUse (
367- f"PWM channel { channel } is already in use by pin { PWMOutputDevice ._channels_used [channel ]} . Use a different pin"
367+ "PWM channel {} is already in use by {}. Use a different pin" .format (
368+ channel ,
369+ str (PWMOutputDevice ._channels_used [channel ])
370+ )
368371 )
369372 else :
370- PWMOutputDevice ._channels_used [channel ] = pin_num
373+ PWMOutputDevice ._channels_used [channel ] = self
371374
372375 def _state_to_value (self , state ):
373376 return (state if self .active_high else self ._duty_factor - state ) / self ._duty_factor
You can’t perform that action at this time.
0 commit comments