performing infinite loop while awaiting input
问题 I have a little project I'm working on, it's fairly simple so I'm hoping someone can help me. I'm using a raspberry pi to dim a single LED with some very crude PWM. my PWM code looks like this: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(7, GPIO.OUT) frequency = 0.005 dwell = 0.0001 while True: time.sleep(frequency) GPIO.output(7, 1) time.sleep(dwell) GPIO.output(7, 0) Basically, in order for the LED to remain lit at the brightness determined by "dwell" I need that