-
-
Save dobrienSTJ/2f5f9f10eae0f1e8c6f3275e6e644286 to your computer and use it in GitHub Desktop.
STJLOL Sensory
This file contains 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
import RPi.GPIO as GPIO | |
from time import sleep | |
GPIO.cleanup() | |
GPIO.setmode(GPIO.BCM) | |
GPIO.setup(17, GPIO.IN) | |
#this was the setup | |
while True: | |
sensor=GPIO.input(17) #this reads from the sensor | |
if sensor==1: #this means there is no signal | |
print("I SEE NAAAAAA'N) | |
sleep(0.1) | |
elif sensor==0: #this means there is a signal | |
print("OH LOOOOOOK! IT'S A SOMETHING!) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment