user77765: I'm trying to connect two D1 Mini's together as a POC.
There is a switch on one and a 7 segment display on the other
I have the pins setup from TX>RX and RX>TX
First ESP8266:
int SWITCH_PIN = D5;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(SWITCH_PIN, INPUT);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  
  if(digitalRead(SWITCH_PIN) == HIGH)
  {
    Serial.println(1);
    digitalWrite(LED_BUILTIN, HIGH);
  }
  else
  {
    Serial.println(0);
    digitalWrite(LED_BUILTIN, LOW); 
  }
}

Second ESP8266:
#include "DigitLedDisplay.h"
DigitLedDisplay ld = DigitLedDisplay(D6, D5, D0);

void setup() {

  Serial.begin(115200);
  
  ld.setBright(10);
  ld.setDigitLimit(8);
  
  for (long i = 0; i < 100; i++) {
    ld.printDigit(i);
    delay(25);
  }
  
}

void loop() {
  delay(1000);
  if(Serial.read() == 1)
  {
    ld.printDigit(11111111);
  }
  else if (Serial.read() == 0)
  {
    ld.printDigit(22222222);
  }
  else
  {
    ld.printDigit(33333333);
  }
}

As far as I can tell the second ESP8266 isn't getting anything from the first. What am I doing wrong?
Thanks in advance for the help

user77765: Thanks to Juraj it was an easy fix
Missing quotes around the text and changing some code
void loop() {
  if (Serial.available() > 0)
  {
    // read the incoming byte:
    incomingByte = Serial.read();
  }
  if(incomingByte == '1')
  {
    ld.printDigit(11111111);
  }
  else if (incomingByte == '0')
  {
    ld.printDigit(22222222);
  }
}

adding "if (Serial.available() > 0)" works to make it only update when the serial buffer is full
The delay was also causing issues with where it was located so just removed that

77765: <p>I'm trying to connect two D1 Mini's together as a POC.
There is a switch on one and a 7 segment display on the other</p>
<p>I have the pins setup from TX&gt;RX and RX&gt;TX</p>
<p>First ESP8266:</p>
<pre><code>int SWITCH_PIN = D5;

void setup() {
  // put your setup code here, to run once:
  Serial.begin(115200);
  pinMode(SWITCH_PIN, INPUT);
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
  
  if(digitalRead(SWITCH_PIN) == HIGH)
  {
    Serial.println(1);
    digitalWrite(LED_BUILTIN, HIGH);
  }
  else
  {
    Serial.println(0);
    digitalWrite(LED_BUILTIN, LOW); 
  }
}
</code></pre>
<p>Second ESP8266:</p>
<pre><code>#include &quot;DigitLedDisplay.h&quot;
DigitLedDisplay ld = DigitLedDisplay(D6, D5, D0);

void setup() {

  Serial.begin(115200);
  
  ld.setBright(10);
  ld.setDigitLimit(8);
  
  for (long i = 0; i &lt; 100; i++) {
    ld.printDigit(i);
    delay(25);
  }
  
}

void loop() {
  delay(1000);
  if(Serial.read() == 1)
  {
    ld.printDigit(11111111);
  }
  else if (Serial.read() == 0)
  {
    ld.printDigit(22222222);
  }
  else
  {
    ld.printDigit(33333333);
  }
}
</code></pre>
<p>As far as I can tell the second ESP8266 isn't getting anything from the first. What am I doing wrong?</p>
<p>Thanks in advance for the help</p>
 77765: <p>Thanks to <a href="https://arduino.stackexchange.com/users/37622/juraj">Juraj</a> it was an easy fix</p>
<p>Missing quotes around the text and changing some code</p>
<pre><code>void loop() {
  if (Serial.available() &gt; 0)
  {
    // read the incoming byte:
    incomingByte = Serial.read();
  }
  if(incomingByte == '1')
  {
    ld.printDigit(11111111);
  }
  else if (incomingByte == '0')
  {
    ld.printDigit(22222222);
  }
}
</code></pre>
<p>adding &quot;if (Serial.available() &gt; 0)&quot; works to make it only update when the serial buffer is full</p>
<p>The delay was also causing issues with where it was located so just removed that</p>
