Raspberry Pi Led Kontrol

Bu tarifimde Raspberry pi kullanarak Led kullanımını , giriş çıkış pinlerinin kullanılmasını anlatmaya çalıştım…

import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM) #led = 25

GPIO.setwarnings(False)
led_bir = 5
led_iki = 6
led_uc = 13
buzzer = 26
GPIO.setup(led_bir,GPIO.OUT)
GPIO.setup(led_iki,GPIO.OUT)
GPIO.setup(led_uc,GPIO.OUT)
GPIO.setup(buzzer,GPIO.OUT)

while True:
GPIO.output(led_bir,1)
GPIO.output(led_iki,0)
GPIO.output(led_uc,0)
GPIO.output(buzzer,0)
time.sleep(0.3)

GPIO.output(led_bir,1)
GPIO.output(led_iki,1)
GPIO.output(led_uc,0)
GPIO.output(buzzer,0)
time.sleep(0.3)
GPIO.output(led_bir,1)
GPIO.output(led_iki,1)
GPIO.output(led_uc,1)
GPIO.output(buzzer,0)
time.sleep(0.3)
GPIO.output(led_bir,1)
GPIO.output(led_iki,1)
GPIO.output(led_uc,1)
GPIO.output(buzzer,1)
time.sleep(0.3)
GPIO.output(led_bir,0)
GPIO.output(led_iki,0)
GPIO.output(led_uc,0)
GPIO.output(buzzer,0)
time.sleep(0.3)
#GPIO.cleanup()

GPIO.output(led_bir,1)
GPIO.output(led_iki,1)
GPIO.output(led_uc,0)
GPIO.output(buzzer,0)
time.sleep(0.3)
GPIO.output(led_bir,1)
GPIO.output(led_iki,1)
GPIO.output(led_uc,1)
GPIO.output(buzzer,0)
time.sleep(0.3)
GPIO.output(led_bir,1)
GPIO.output(led_iki,1)
GPIO.output(led_uc,1)
GPIO.output(buzzer,1)
time.sleep(0.3)
GPIO.output(led_bir,0)
GPIO.output(led_iki,0)
GPIO.output(led_uc,0)
GPIO.output(buzzer,0)
time.sleep(0.3)
#GPIO.cleanup()

Sosyal Medyada Paylaş Facebook Twitter Google+

Etiketler: , , , , ,
Eklenme Tarihi: 26 Nisan 2020

Konu hakkında yorumunuzu yazın

HOŞ GELDİNİZ

Youtube kanalıma Abone Olabilirsiniz.