示例#1
0
def lock():
  """
  Given info from lock_state(), controls servomotor and lock deadbolt
  """
  motor = l293d.motor(0,0,0) # input pins the motor uses
  for i in range(0,150): # change 150 to fit needs
    motor.counterclockwise()
  l293d.cleanup()
示例#2
0
def close():
    global stopThreads

    logging.info("\nMain    : Turning off sensors and motors...\n")

    stopThreads = True
    GPIO.cleanup()
    l293d.cleanup()
    sys.exit(0)
示例#3
0
    def release(key):
        if key == Key.up:
            GPIO.output(MotorA3, GPIO.LOW)
        if key == Key.down:
            GPIO.output(MotorA3, GPIO.LOW)
        if key == Key.left:
            GPIO.output(MotorB3, GPIO.LOW)
        if key == key.right:
            GPIO.output(MotorB3, GPIO.LOW)

        if key == Key.esc:
            keepGoing = False
            l293d.cleanup()
            GPIO.cleanup()
            return False