Arduino code for a simple (physical) lock position detector