while(Serial.available() < 1) {} // wait until 1 byte is available on serial port
for(int i=0;i<1;i++) {
received_data[i] = Serial.read(); // read 1 byte
Serial.println(received_data[i]);
}
This is all confused.
Serial.available() < 1 is the same as Serial.available == 0 which is hardly what you want?
What does for(int i=0;i<1;i++) do? Especially as you only want to read a single character.
...R