support serial communication and TFT display

  int buf[238];

What's this huge array for? That's using 1/4 of the memory on a 328-based Arduino.