I am trying to control a relay with Pi3B.
Whenever I run
GPIO.setup(port, GPIO.OUT) my relay starts working,
then any other command I try, eg.
GPIO.output(port, GPIO.HIGH) or
GPIO.output(port, GPIO.LOW) doesn't change the relay
Agian When I switch the
GPIO.setup(port, IN) or
GPIO.cleanup() my relay turns off. So only way I can control that relay is changing the IN/OUT mode of that port. What is missing here?
Here is my connection.
VCC - Pi Board Pin 02
GND - Pi Board Pin 06
IN - Pi Board pin 08
Relay is 220v- 5v one channel relay