I need some help to make it work, read the card and open the relay
the esp8266 and the RFID work just fine, but when connected to the relays Elegoo4 can't even upload the code to the esp8266
RELAY is connected to D8, GND,+5 v on the esp8266 (not on the picture)
* question: do I need an external 5v power supply?
what I am doing wrong ??
the esp8266 and the RFID work just fine, but when connected to the relays Elegoo4 can't even upload the code to the esp8266
RELAY is connected to D8, GND,+5 v on the esp8266 (not on the picture)
* question: do I need an external 5v power supply?
what I am doing wrong ??
B4X:
Sub Process_Globals
Public Serial1 As Serial
Private rfid As MFRC522
Private bc As ByteConverter
Dim d1 As D1Pins
Private d8 As Pin
Private relay1 As Pin
Private relay1State As Boolean
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
d8.Initialize(d1.D8, d8.MODE_OUTPUT)
'relay1.Initialize(d1.D8, relay1.MODE_OUTPUT) 'Pin D8 ESP Relay 1
d8.DigitalWrite(True)'True = 1 | Pin D8 Esp is Off | Relay_1 is Off
relay1State = True
rfid.Initialize(d1.D4, d1.D3, "rfid_CardPresent")
rfid.LogVersion
End Sub
Sub rfid_CardPresent (UID() As Byte, CardType As Byte)
Log("UID: ", bc.HexFromBytes(UID))
relay1State = Not(relay1State)
Log(relay1State)
d8.DigitalWrite(relay1State)'Relay 1 ON/OFF House Alarm
End Sub