Sending data from arduino to esp8266

Hello everyone. I've been trying to read the incoming data from arduino uno to esp module but the problem is that every 100ms I print in the arduino by serial port a value (example: 76) , when my esp connect and get the data the incoming value is 767676... something like this. Now I need to iterate the loop every 100ms in my arduino board. Is possible to clear the serial port in every iteration loop for avoid this result? Below I leave my code. Thank you in advance

//Arduino void loop() { Serial.print("76"); delay(100); }

//ESP8266 Module void loop() { if (Serial.available() > 0) { while (Serial.available() > 0) { data[pos++] =; //data is the incoming data } } data[pos] = '\0'; server.handleClient(); pos = 1; delay(1000); }

See Serial Input Basics - updated to get ideas to create reliable communication. You at least want an end marker to be able to determine the end of the received data.

For example 2, your arduino code could be


For example 3, your arduino code could be


I leave the ESP implementation up to you.

Thank you so much for your help. I appreciate it