Help: RFID and serLCD

  if(dat >= 0x30 && dat <= 0x39)

Google for an ASCII code chart. This is the same as:

  if(dat >= '0' && dat <= '9')

That's more readable, don't you think?