feat: add start script
This commit is contained in:
3
relay.py
3
relay.py
@@ -6,8 +6,6 @@ import time
|
||||
class Relay:
|
||||
def __init__(self, pin):
|
||||
self.pin = pin
|
||||
|
||||
def setup(self):
|
||||
GPIO.setmode(GPIO.BOARD)
|
||||
GPIO.setup(self.pin, GPIO.OUT, initial=GPIO.HIGH)
|
||||
|
||||
@@ -22,7 +20,6 @@ class Relay:
|
||||
|
||||
if __name__ == '__main__':
|
||||
relay = Relay(12)
|
||||
relay.setup()
|
||||
relay.turn_on()
|
||||
time.sleep(5)
|
||||
relay.turn_off()
|
||||
|
||||
Reference in New Issue
Block a user