I am currently using Raspberry PI to to control a 2 switch relay. I am testing it with the most basic code just switching one of them on and off. Before I connect it to something live I want to make sure I have this figured out as it seems there is something weird going on. It seems like my states are the wrong way around.
Here is my code:
import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(5,GPIO.OUT)
Now the issue is with the last line. The moment I use that command my GPIO pin activates however, on all tutorials this is not the case.
The next part is if I call:
I would expect it to turn off however I need to use:
To power it off. To be honest it doesn't make much of a difference however I don't like the fact that it is on by default. Apart from that it works as expected. Tested with LEDs and had the same effect.
I am really new so might be missing something simple. Any help would greatly be appropriated.