Need help on how to approch 12v digital read on a blinking signal

that solves the input problem. thankyou can anyone explain how to code it?