import RPi.GPIO as GPIO from time import sleep GPIO.setwarnings(false) GPIO.setmode(GPIO.BCM) Blink_count=3 count=0 LEDPin=17 GPIO.setup(LEDPin,GPIO.OUT) try: while count < Blink_count: GPIO.output(LEDPin,False) print("LED OFF") sleep(1) count+=1 finally: GPIO.cleanup()
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter