Code to recognize digits on a display