Serial.read Odd behavior

Hello I have this simple pice of code and when I press 0 for instance I got an 48 for ASCCI 0 what is OK, but then w chances to 10 and I don't have a clue why that is ?!

uint8_t w

void loop() {

if (Serial.available() > 0) { w = Serial.read(); // Serial.print("Got a byte : "); // Serial.println(w, DEC); }

/*

switch (w) { case 48: Cycle(); break; case 49: FadeOut(); break; case 50: Mode1(); break; } */

delay(10);

Serial.print("Loop : "); Serial.println(w, DEC);

}

Did you press return after you pressed 0?

ASCII 10 is the code for a line feed.

then w chances to 10 and I don't have a clue why that is ?

Check the Line ending setting in the Serial monitor

10 is the ASCII code for Linefeed, which is what I suspect you have the Line ending set to