-a cable from the + side of the battery goes to the middle of the relay (C)
-a cable from the NO of the relay goes to one leg of the led.
-a cable from the - side of the battery goes to the other leg of the led.
Once everything is connected i see the led to be switched on.
the pin used in ESP8266 nodemcu to connect to is the D1.
then i issue on the repl:
Code: Select all
from machine import Pin relay = Pin(5, Pin.OUT) relay.value(0) # to switch it off relay.value(1) # to switch it on
thanks in advance.