Actually i just need whether the values are changing (somebody is moving the sensor), and i think this is more than enough for this purpose. I’m more than happy with this solution, so thanks again!
Hi @kennethlimcp, I seem to be able to get the no-library example working, however I need to take quicker readings and when I remove the delay at the end of the main loop the photon seems to lock up very quickly. Is this a known problem? Thanks
The recommended output datarate of the chip is 12.5-400Hz.
Although datasheet also shows a current-datareate diagram of up to 3200Hz, without delay I’d guess you might get a bit too fast.
If you are cloud-bound and single threaded you’ll have a 1ms delay between each interation of loop() limiting you to 1kHz already, so adding another delay(2); should bring you bellow 400Hz, but do you really need to be that quick - try not to go bellow 10ms delay?
I’m not too familiar with this chip, but others do feature an interrupt output to inform the controler when data is ready - this should give you the fastest possible speed, but usually requires more setup work in code and on the chip.