Your new topic does not fit any of the above??? Check first. Then post here. Thanks.

Moderator: igrr

User avatar
By f42ter
#50955 Could you please provide some more details.

This is not tested yet. I just start to play with my nodemcu.

If you code nodemcu using the Arduino IDE you may use

... fragment Arduino Board
// Arduino Code
#include <SoftwareSerial.h>
SoftwareSerial mySerial(7, 8); // RX, TX on nodemcu
... fragment Arduino Board

... fragment nodemcu Board
// nodemcu Code
#include <SoftwareSerial.h>
SoftwareSerial mySerial(8, 7); // RX, TX on Arduino
... fragment nodemcu Board

Connect 7 to 8 and 8 to 7 but you need a level converter (3.3v mode nodemcu) to protect the
nodemcu input pins.

At least you implement a communication protocol to send data between both boards.

f41*
User avatar
By Andres Cotes
#51450 esp8266 nodemcu

#include <SoftwareSerial.h>
SoftwareSerial mySerial(13, 15); // RX, TX nodemcu

void setup() {


Serial.begin(9600);
mySerial.begin(9600);
pinMode(13,OUTPUT);
}

void loop() {
char dato = Serial.read();
char dato2 = mySerial.read();

int tiempo = 100;
if (dato == 'S'){
mySerial.write(45);
digitalWrite(13, HIGH);
Serial.println("LETRA S ENVIADA");
}
if (dato == 'A'){
mySerial.write(58);
digitalWrite(13, LOW);
Serial.println("LETRA A ENVIADA");
}
if (dato2 == 58){

digitalWrite(13, HIGH);
Serial.println("LETRA S RECIBIDA");
}
if (dato2 == 45){

digitalWrite(13, LOW);
Serial.println("LETRA A RECIBIDA");
}



}