22 lines
295 B
Python
Executable File
22 lines
295 B
Python
Executable File
#!/usr/bin/python3
|
|
|
|
import RPi.GPIO as GPIO
|
|
import time
|
|
import sys
|
|
|
|
GPIO.cleanup()
|
|
GPIO.setmode(GPIO.BCM)
|
|
GPIO.setup(23, GPIO.OUT)
|
|
|
|
GPIO.output(23, 0)
|
|
|
|
while True:
|
|
time.sleep(5)
|
|
GPIO.output(23, 1)
|
|
print("on")
|
|
time.sleep(5)
|
|
GPIO.output(23, 0)
|
|
print("off")
|
|
|
|
GPIO.cleanup()
|