Created
May 7, 2018 21:56
-
-
Save Unitoi01/c779b7c5bcb1be53b284a99252f5a9c1 to your computer and use it in GitHub Desktop.
New Button.py
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
#!/usr/bin/python2 | |
import RPi.GPIO as GPIO | |
import time | |
import os | |
GPIO.setmode(GPIO.BCM) | |
buttonPin = 4 | |
lightPin=3 | |
GPIO.setup(buttonPin, GPIO.IN,pull_up_down=GPIO.PUD_UP) | |
GPIO.setup(lightPin, GPIO.OUT) | |
while True: | |
GPIO.output(lightPin,GPIO.HIGH) | |
input=GPIO.input(4) | |
if input==GPIO.HIGH: | |
print("it works") | |
os.system("python /home/pi/Python-Thermal-Printer/print_sound.py") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment