Skip to content

Commit 6c35a53

Browse files
committed
Fix bug with PWM choosing pin number for Raspberry Pi.
1 parent dff65be commit 6c35a53

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Adafruit_GPIO/PWM.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def start(self, pin, dutycycle, frequency_hz=2000):
4646
if dutycycle < 0.0 or dutycycle > 100.0:
4747
raise ValueError('Invalid duty cycle value, must be between 0.0 to 100.0 (inclusive).')
4848
# Make pin an output.
49-
self.rpi_gpio.setup(12, self.rpi_gpio.OUT)
49+
self.rpi_gpio.setup(pin, self.rpi_gpio.OUT)
5050
# Create PWM instance and save a reference for later access.
5151
self.pwm[pin] = self.rpi_gpio.PWM(pin, frequency_hz)
5252
# Start the PWM at the specified duty cycle.

0 commit comments

Comments
 (0)