Object recognition code for laser stick control