123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- !
- import RPi.GPIO as GPIO
- import time
- import os
- GPIO.setmode(GPIO.BCM)
- GPIO.setup(23, GPIO.OUT)
- GPIO.setup(24, GPIO.IN)
- printer_state = GPIO.input(24)
- if printer_state = 0:
- print "Printer state is on, state =", printer_state
-
- else:
- while printer_state != 0:
- printer_state = GPIO.input(24)
- GPIO.output(23, 1)
- time.sleep(30)
- print "Done resting"
- qstate = 0
- mystring = "none"
- while qstate != 0:
- if mystring.find("no entries"):
- qstate = 0
- print "queue state is:", qstate
- else:
- os.popen('lpc restart')
- print "Passed qstate test"
- while printer_state != 1:
- printer_state = GPIO.input(24)
- GPIO.output(23, 0)
- GPIO.cleanup()
|