Nextion + blynk + IRremote+8button +relay8ch on off = Esp8266 v2

ฉัน Nextion + blynk + IRremote+8button +relay8ch on off = Esp8266 v2
กดรีโมท แล้วมีบัคนิดหน่อย รหัสของฉันยาวมาก ใครช่วยเขียนให้สั้นๆหน่อย

1 Like

It might have nothing to do with your problem, but the NodeMCU doesn’t have enough useable pins to allow you to control 8 relays.
In addition you seem to have a serial connection for your Nextion and another pin used as an IR receiver or transmitter.

You should swap to using an ESP32 instead.

Pete.

1 Like

SoftwareSerial nextion(4, 0);
RECV_PIN = 14;
int out1 = 10;
int out2 = 5;
int out3 = 16;
int out4 = 1;
int out5 = 2;
int out6 = 12;
int out7 = 13;
int out8 = 3;

analogPin = A0; pin 8buttion
PIN D8 // pinLED2812b
NUMPIXELS 8

ฉันใช้อยู่ blynk + IRremote+8button +relay8ch on off = Esp8266 v2
ไมมีปัณหา แต่รหัสยาว 1257 บรรทัด ฉันเขียนรหัสเองไม่เป็น ใช้ก๊อปเอาครับ

You should read this…

You will see that there are really only 5 pins that can safely be used on the NodeMCU.

Pete.

2 Likes