You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1011 B
Python

2 years ago
# button setup (connect to 3.3V and GPIO Pin 16)
import RPi.GPIO as GPIO # GPIO pins
import time
import os # library to use bash commands
def preview(final_module):
while True: # Run forever
GPIO.setmode(GPIO.BOARD) #Use the physical GPIO number
GPIO.setup(16, GPIO.IN, pull_up_down=GPIO.PUD_DOWN) #Change pin if necessary
GPIO.setwarnings(False) #Ignore warnings
if GPIO.input(16) == GPIO.HIGH:
time.sleep(1)
# print(final_module)
os.system("gv -fullscreen " + final_module + ".ps")
GPIO.cleanup() #GPIO clean up
else:
break
# problems:
# interrupts read_values.py
# does not refresh
#import os # library to use bash commands
#import keyboard
#import time
#import mouse
#def preview(final_module):
# os.system("gv -fullscreen " + final_module + ".ps")
# while True:
# mouse.move('500', '500')
# keyboard.send(".")
# sleep(3)
#preview("test-preview")