You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the accelerometer and ambient light & sound modules, I can just listen for the values as events and they come - I don't have to ask for them. I can't do that here; you have to ask for them
I thought at first it was because it just didn't make sense to do it; but when you think about it, theres no difference between temperature and light levels for example.
Being able to do things the same way across all the modules would be great, right now, I have to write a loop which picks up the value every x milliseconds
The text was updated successfully, but these errors were encountered:
The short answer is because they were written by different authors at different times but there is no reason why we can't add it to this API.
The accelerometer chip actually pulls an interrupt line low when it has a new sensor reading available so an event-based system makes sense there. The ambient module just uses setTimeout with a timeout value that's available to users of the API. The latter probably makes the most sense here.
On the accelerometer and ambient light & sound modules, I can just listen for the values as events and they come - I don't have to ask for them. I can't do that here; you have to ask for them
I thought at first it was because it just didn't make sense to do it; but when you think about it, theres no difference between temperature and light levels for example.
Being able to do things the same way across all the modules would be great, right now, I have to write a loop which picks up the value every x milliseconds
The text was updated successfully, but these errors were encountered: