Jun-07-2019, 01:32 PM
I think you'll have to start a Thread in
If the press button is OFF you'll have to set a "global stop variable" (
swLed()
that could trigger a while loop to blink the LED (if button is pressed [ON]).If the press button is OFF you'll have to set a "global stop variable" (
keep_blinking = False
) to break the blink LED loop.def my_thread_function(): led_state = 1 while keep_blinking: GPIO.output(LedPin, led_state) led_state = not led_state time.sleep(0.1)