Skip to content

Instantly share code, notes, and snippets.

@ikizoglu
Created February 5, 2026 21:16
Show Gist options
  • Select an option

  • Save ikizoglu/5964e158c4301d583fd89c5f504e516c to your computer and use it in GitHub Desktop.

Select an option

Save ikizoglu/5964e158c4301d583fd89c5f504e516c to your computer and use it in GitHub Desktop.
#RaspberryPi Temel Buton Kodu
#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