from gpiozero import LED from time import sleep red_led = LED(16) print("LED long tail on BCM17 - pin 11, other connection on ground\n") print("testing LED ON for 5 s ..... \n") red_led.on() sleep(5) print("testing LED OFF for 5 s ..... \n") red_led.off() sleep(5) print("NOW blink LED 5 times ..... \n") for i in range(5): red_led.on() sleep(1) red_led.off() sleep(1) sleep(2) print("NOW blink LED 5 times faster ..... \n") red_led.blink(0.2, 0.2, 10) sleep(2) print("NOW blink LED 5 times much faster ..... \n") red_led.blink(0.1, 0.1, 10) sleep(2) print("NOW toggle LED\n") red_led.toggle() print(red_led.is_lit) sleep(2) print("NOW toggle again LED\n") red_led.toggle() print(red_led.is_lit) print("THE END\n")