Call a function on puck.light() change value #3787
Replies: 4 comments
-
Posted at 2021-08-02 by @gfwilliams Hi! I'm afraid you can't easily do the check 'in hardware' - it is possible to a very limited extent, but it's not very flexible. Checking |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-08-02 by user130485 thank you. I was going to use it as an alarm when someone opens my meterbox. But bluetooth advert will most likely be lost amongst other info that is sent |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-08-02 by @gfwilliams
What I usually suggest is you send a single byte that increments each time the event occurs - eg the box is opened. That way it doesn't matter if you miss a bunch of advertisements, you still know if that number has risen that something happened. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2021-08-02 by user130485 agree but dont want to be sending extra info. Like I don't really care in the evening that meterbox was opened some time during the day. Just means that I would have to add it to every advertisement |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2021-07-31 by user130485
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
Beta Was this translation helpful? Give feedback.
All reactions