I think the Hall Effect sensor is probably the best suggestion so far as the IR solutions (even the Sharp GP2Y0A41SK0F) would probably get blocked or interfered with by the walls or the spring. However @allObjects 's resistive tape idea is also good. Thanks for your replies.
P.S Nice to see your back Gordon, hope you had a nice time.
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
I think the Hall Effect sensor is probably the best suggestion so far as the IR solutions (even the Sharp GP2Y0A41SK0F) would probably get blocked or interfered with by the walls or the spring. However @allObjects 's resistive tape idea is also good. Thanks for your replies.
P.S Nice to see your back Gordon, hope you had a nice time.