Arduino Newline in serial monitor (Help)
<p>I want to develop a program that can read and receive a byte data from the serial, but my problem is when I'm testing the code below in serial monitor, I must change the serial monitor into newline format first, if any of you that can help me to input the data without change the newline format in serial monitor.</p>

<p>Here is the code:</p>

<pre><code>byte alarmhour = 0;
byte alarmminute = 0;

void setAlarm() {
    Serial.print("Please enter the alarm hour in 24hr format, 0-23. - ");
    alarmhour = readByte();
    Serial.println(alarmhour);
    Serial.print("Please enter the alarm minute, 0-59. - ");
    alarmminute = readByte();
    Serial.println(alarmminute);
    Serial.println("The data has been entered.");

    EEPROM.write(addr + 2, alarmminute);
    EEPROM.write(addr + 3, alarmhour);
}

byte readByte() {
    while (!Serial.available()) delay(10);
    byte reading = 0;
    byte incomingByte = Serial.read();
    while (incomingByte != '\n') {
        if (incomingByte &gt;= '0' &amp;&amp; incomingByte &lt;= '9'){
            reading = reading * 10 + (incomingByte - '0');
        }else{
            incomingByte = Serial.read();
        }
    }
    Serial.flush();
    return reading;
}
</code></pre>

<p>Thanks.</p>