char ch;
void setup()
{
Serial.begin(9600);
Serial.println("press any key ");
}
void loop()
{
if (Serial.available())
{
ch = Serial.read();
if (ch != '\n')
{
Serial.print("Ascii code in decimal: ");
Serial.println(ch, DEC);
Serial.print("Ascii code in hexa: ");
Serial.println(ch, HEX);
Serial.print("Ascii code in OCT : ");
Serial.println(ch, OCT);
Serial.print("Ascii code in BIN : ");
Serial.println(ch, BIN );
}
}
}