In this blog, I will explain how to blink a led using raspberry pi 3 with python code.
Step1- Make connection as shown in above figure.
Components Required
1. Raspberry pi 3
2. Led
3. jumper wires
4. Breadboard
5. 220 ohm Resistor
Circuit Diagram
Step1- Make connection as shown in above figure.
Step2- Connect led +ve pin to 7 pin of raspberry pi and -ve pin of led to 39 pin of raspberry pi.
Step3- Resistor must be connected otherwise led will fused.
Step4- Download the code and upload the raspberry pi.
via element14.com |
Program Code
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7,GPIO.OUT)
i = 1
while(i<=5):
GPIO.output(7,True)
time.sleep(1)
GPIO.output(7,False)
time.sleep(1)
i = i + 1
GPIO.cleanup()
Github Link-https://github.com/amanjaiswal210
Media Gallary
0 comments:
Post a Comment