Instructions

www.joy-it.net
Pascalstr. 8 47506 Neukirchen-Vluyn
2. SETUP WITH THE RASPBERRY PI
Code example:
If the signal pin is set to high, the output is enabled.
In the following code example, all output are enabled every 10 seconds for 5 seconds.
from time import sleep
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
CH1 = 22
CH2 = 27
CH3 = 17
CH4 = 23
GPIO.setup(CH1, GPIO.OUT)
GPIO.setup(CH2, GPIO.OUT)
GPIO.setup(CH3, GPIO.OUT)
GPIO.setup(CH4, GPIO.OUT)
try:
while True:
print ("Enable all outputs")
GPIO.output(CH1, GPIO.HIGH)
GPIO.output(CH2, GPIO.HIGH)
GPIO.output(CH3, GPIO.HIGH)
GPIO.output(CH4, GPIO.HIGH)
sleep(5)
print ("Disable all outputs")
GPIO.output(CH1, GPIO.LOW)
GPIO.output(CH2, GPIO.LOW)
GPIO.output(CH3, GPIO.LOW)
GPIO.output(CH4, GPIO.LOW)
sleep(5)
except KeyboardInterrupt:
GPIO.cleanup()






