This seems like it should be really simple, so maybe I am missing something. I am just trying to open and close my relay but all it does it open's and doesnt close. I can use GPIO.cleanup() to make it close but I dont want to apply this at this point in the project.
UPDATE: 6th Jan 17 As suggested in the comments I have tested the GPIO's and can see that 3.3V comes out when HIGH and it goes back to 0v on LOW. But LOW does not turn off the relay oddly. I have tried 2 of these relays and both do not switch off when at LOW (0v).
I have tried to find the original documentation for GPIO.clean() function since this allows it to close but cant find it. Can anyone think why this does this?
import RPi.GPIO as GPIO from time import sleep relayPin = 32 GPIO.setmode(GPIO.BOARD) GPIO.setup(relayPin, GPIO.OUT) ## Turn on the Relay (this works - it clicks gives 3.3v) GPIO.output(relayPin,GPIO.HIGH) sleep(1) ## Turn off the Relay (this does nothing but goes back to 0v) GPIO.output(relayPin,GPIO.LOW) sleep(1) ## if I add GPIO.cleanup(), the relay then closes, ## but I dont want to cleanup at this point