Created
February 5, 2026 21:16
-
-
Save ikizoglu/5964e158c4301d583fd89c5f504e516c to your computer and use it in GitHub Desktop.
#RaspberryPi Temel Buton Kodu
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #RaspberryPi Temel Buton Kodu | |
| #-------------------------------- | |
| import RPi.GPIO as GPIO | |
| import time | |
| GPIO.setwarnings(False) # Ignore warning for now | |
| GPIO.setmode(GPIO.BOARD) # Use physical pin numbering | |
| GPIO.setup(10, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) # Set pin 10 to be an input pin and set initial value to be pulled low (off) | |
| while True: # Run forever | |
| if GPIO.input(10) == GPIO.HIGH: | |
| print("Button was pushed!") | |
| time.sleep(1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment