1import RPi.GPIO as GPIO # IMPORTANT: remember to change the gpio pin (18) also it needs to be programmed in Thonny Python IDE
2import time #used in raspberry pi model 4
3
4GPIO.setwarnings(False) #NOTE: raspberry pi could be updated, and you might need to change your code
5GPIO.setmode(GPIO.BCM)
6GPIO.setup(18, GPIO.OUT)
7
8
9while True:
10 GPIO.output(18, True)
11 time.sleep(1)
12 GPIO.output(18, False)
13 time.sleep(1)