from gpiozero import PWMOutputDevice from time import sleep out_dev = PWMOutputDevice(7) print("LED long tail on BCM17 - pin 11, other connection on ground\n") out_dev.on() sleep(2) print("testing DEV ON for 5 s 100%..... \n") out_dev.value=1.0 sleep(5) print("testing DEV ON for 5 s 80%..... \n") out_dev.value=0.9 sleep(5) print("testing DEV ON for 5 s 60%..... \n") out_dev.value=0.6 sleep(5) print("testing DEV ON for 5 s 40%..... \n") out_dev.value=0.4 sleep(5) print("testing DEV OFF for 3 s ..... \n") out_dev.off() sleep(5) print("THE END\n")