LED-Raspberry Pi
Sun Jun 09 2024 04:50:55 GMT+0000 (Coordinated Universal Time)
Saved by
@user01
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()
content_copyCOPY
Comments