/* Program 4-3: Echo the received characters of the Serial port * The Arduino echo back the received character. */ void setup() { Serial.begin(9600); /* initialize Serial and set the Baud rate to 9600 */ } void loop() { while (!Serial.available()) { } /* wait until a char is available */ char c = Serial.read(); /* read the character */ Serial.write(c); /* echo the character received */ }