I want to start the LED gradually with dimming by using PWM.
And then once at a
ChangeDutyCycle(100) I want it to remain on
import RPi.GPIO as GPIO import time led = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(led, GPIO.OUT) def dim(): green = GPIO.PWM(led, 100) green.start(0) pause_time = 0.010 for i in range(0, 100+1): green.ChangeDutyCycle(i) time.sleep(pause_time) GPIO.output(led, GPIO.HIGH) dim()
But with the script below it just turns off.
Is this possible?