I would like some code to run as soon as light comes above a certain level.
But to save battery I would like to do that with setWatch, is that possible?
It's a nice idea, but I'm afraid it isn't possible... At least at the moment reading from the light sensor requires an analog to digital conversion, which can't be done without waking the device up - and if it's awake it's not that painful to get JS to do the reading for you.
Don't worry about formatting, just type in the text and we'll take care of making sense of it. We will auto-convert links, and if you put asterisks around words we will make them bold.
For a full reference visit the Markdown syntax.
© Espruino, powered by microcosm.
Report a problem