Hello
How would I go about calling a function when the level of ambient light changes?
I want to predefine parameters and call a function if its within a certain range.
Does it use much power to do puck.light() checks? If I just do setInterval to 1 second to check the value and if its outside a predefined level call a function - will it impact the battery much? Would prefer a neater way to do it if possible
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.
Hello
How would I go about calling a function when the level of ambient light changes?
I want to predefine parameters and call a function if its within a certain range.
Does it use much power to do puck.light() checks? If I just do setInterval to 1 second to check the value and if its outside a predefined level call a function - will it impact the battery much? Would prefer a neater way to do it if possible