First Raspberry Pi Blink Project

Circuit:

Code:

1
2
3
4
5
6
7
8
9
10
11
12
13
import RPi.GPIO as GPIO
import time

GPIO.setmode(GPIO.BCM)
GPIO.setup(18, GPIO.OUT)
for i in range(10):
GPIO.output(18, GPIO.HIGH)
time.sleep(1)
GPIO.output(18, GPIO.LOW)
time.sleep(1)

GPIO.cleanup()