This repository has been archived on 2019-10-02. You can view files and clone it, but cannot push or open issues or pull requests.
Files
DoorUnlocker/unlocker.py
2019-04-21 14:43:43 +08:00

21 lines
310 B
Python

import time
import CHIP_IO.GPIO as GPIO
def run(pin: str):
GPIO.setup(pin, GPIO.OUT)
GPIO.output(pin, GPIO.LOW)
print("[Door] Unlocking...")
time.sleep(0.4)
GPIO.output(pin, GPIO.HIGH)
print("[Door] Unlocked!")
GPIO.cleanup(pin)
if __name__ == '__main__':
run("XIO-P7")