21 lines
310 B
Python
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")
|