Here’s a sketch for running ‘Pong’, the mother of all computer games, on an Arduino Uno. It uses a 3.5″ (480×320) TFT screen and two rotary encoders.

I wrote this sketch for examining the graphics performance of my (rather slow) Adafruit TFT screen. The results are quite acceptable, so I may build in some additional features like topspin/backspin and variable speed in due course.

An explanation of the use of hardware interrupts for reading rotary encoders can be found in my previous post on Rotary Encoders.