You read x and print it. Then you read another character and check if that is 255 to switch the LED on.
Steve