I have two pins with the same frequency (10Hz) and same duty cycle (50%) assigned to two different leds. How can I make the two leds blink alternatively? How can I put a delay of 50% in one of the pins?
Thanks in advance
import RPi.GPIO as GPIO import time L1 = 36 l2 = 37 frequency = 10 GPIO.setmode(GPIO.BOARD) GPIO.setup(L1, GPIO.OUT) GPIO.setup(L2, GPIO.OUT) led1 = GPIO.PWM(L1, frequency) led2 = GPIO.PWM(L2, frequency) led1.start(50) led2.start(50) time.sleep(10) led1.stop() led2.stop() GPIO.cleanup()