I am trying to turn a relay on and off using a python script. The below script is realy simpel, turn the relay on and after 5 seconds turn it off.
The thing is, it dooesn't turn off. i thought it did because i had the cleanup() in there. But no...
It is probably something realy dumd that i am forgetting.
#!/usr/bin/env python
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(27, GPIO.OUT)
GPIO.setup(26, GPIO.OUT)
GPIO.output(27, GPIO.LOW)
GPIO.output(26, GPIO.LOW)
time.sleep(5)
GPIO.output(27, GPIO.HIGH)
GPIO.output(26, GPIO.HIGH)
print("wegwgwegweg")
time.sleep(10)
GPIO.cleanup()
The relay bnoard that i am using is:
https://www.kiwi-electronics.nl/nl/16-kanaals-5v-relais-module-4322
Note that i am only using 3 relay's currently to limit the power usage of the 5v line on the PI
GPIO.LOW
Turns the relay on. How would you suggest doing it?