If longer delay() doesn't solve the problem,
how about trying to control the sending interval using a timer like the following?
int sensorValue = 0;
long previousMillis = 0;
long interval = 500;void setup() {
Serial.begin(9600);
int readSensorValue();
}void loop() {
if ( Serial.available() ) {
if ( Serial.read() == 'R' ) { // "R" is the byte addressing the robot
Serial.println("Byte received");
}
}
if (millis() - previousMillis > interval) {
previousMillis = millis();
sensorValue = readSensorValue();
Serial.println(sensorValue );
}
}int readSensorValue(){
// this function returns the sensor reading
}