Grove - 2-Channel SPDT Relay Raspberry Pi 3B+

I would like to use a 2-Channel Grove Relay on a Rpi3B+. The most important thing is to use the 2 channel differently. Because if i write the code for example on the D3 port, it writes for both channels.

Relay_pin = 3

pinMode(Relay_pin,“OUTPUT”)

digitalWrite(Relay_pin,1)
sleep(2000)
digitalWrite(Relay_pin,0)

Please help me somehow, how could i write this for the two channel.
If i watch the GrovePi+ pin mappaings, i see that D3 port has a 3,4 pin so that is what i need to write for the 2 channels.

1 Like