I installed the SleepLog app yesterday, that says it uses the internal temperature sensor to help identify if it's on a wrist, there might be something in that app you could reuse rather than start from scratch.
Great - I'll take a look. I also saw an app that scheduled silent times, so I was going to look at the code for that as well to see what I could "borrow".
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 installed the SleepLog app yesterday, that says it uses the internal temperature sensor to help identify if it's on a wrist, there might be something in that app you could reuse rather than start from scratch.