Hi,
It seems to me like you are receiving ASCII so if you want to check for the 'digit' 3 you should compare x to 51 which is the ASCII code for '3'

/Henrik.